JsTree - rendering optimization | very long rendering with 2000 nodes

I am using jsTree (1.0-rc3) with the ability to load data using AJAX, and I have a problem loading about ~ 2000 childs node. While the server is responding for several seconds, it takes jsTree about ~ 40 seconds to get results in the browser (chrome, FF). In addition to this, FF returns no response information from "jquery-1.7.2.min.js". The same amount of data hangs IE. Is it overloaded with data? Or is this some kind of mistake? Are there any plug-in factors that can help me in faster rendering?

jQuery( "#dependency-tree" ).jstree( { 'plugins':['themes', 'json_data', 'ui', 'core', 'types', 'sort'], "json_data":{ "progressive_render": true, "data":initData, cache:false, "ajax":{ "url":function ( node ) { return appContext + 'GetUnitsNode/' + node.attr( 'id' ); }, dataType:"text", "success":function ( data ) { if ( data == "none" ) { return false; } return jQuery.parseJSON( data ); } } }, "ui":{ 'select_limit':1 }, "core":{ 'animation':0, 'html_titles':true }, "themes":{ "theme":"rules", "dots":true, "icons":true }, "types":{ "types":{ "default":{ "icon":{ "image":appContext + "/img/orange.png" } } } }, "sort":function ( a, b ) { return this.get_text( a ).toUpperCase() > this.get_text( b ).toUpperCase() ? 1 : -1; } } ).bind( "select_node.jstree", function ( event, data ) { submitedNodeId = data.rslt.obj.attr( 'id' ); submitedNodeTypeId = data.rslt.obj.attr( "typeId" ); submitedNodeLast = data.inst.is_leaf( data.rslt.obj ); g_node_text = jQuery( data.rslt.obj ).children().eq(1).html(); } ); 
+6
source share
1 answer

You tried?

  • progressive_render

    progressive_render Boolean. The default value is false. If this option is set to true, only the visible (open nodes) parts of the returned JSON are converted to DOM nodes, any hidden parts are saved and analyzed on demand (when the node becomes visible). This is useful when you have a large nested tree that will lead to a heavy DOM

  • Download AJAX

+2
source

All Articles