문제

I use dynatree and everything works fine but if a node has large number of items I get an error. I have read about setting enableUpdate(false); function but it also didn't help. Any ideas?

var serviceParams = { Type: this._fieldName };

$("#tree").dynatree({       
    autoFocus: false,
    clickFolderMode: 1,     
    initAjax: {
        url: tree._serviceUrl + "/top",
        data: jQuery.serializeJSON(serviceParams),
        type: "POST",
        contentType: "application/json; charset=utf-8",
        dataType: "json"
    },

    onLazyRead: function(node) {        

        //this.enableUpdate(false);    

        var serviceParamsForChildren = 
        { 
            Type: tree._fieldName, 
            parentId: node.data.key, 
            includeDescedants: false 
        };

        node.appendAjax({
            url: tree._serviceUrl + "/Children",
            data: jQuery.serializeJSON(serviceParamsForChildren),
            type: "POST",
            contentType: "application/json; charset=utf-8",
            dataType: "json"
        });

        //this.enableUpdate(true);
    },
    onActivate: function(node) {
       tree._selectedNode = node;
    }
});
도움이 되었습니까?

해결책

As per docs

tree.enableUpdate(enable)

Turn rendering on or off and return the previous mode. Disabling update may speedup processing, when adding lots of nodes. Don't forget to turn rendering back on, after applying the changes

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top