Problem solution: The generated tree is loaded step by step, and there is a code for generating nodes in the open function:
Code
for (var i=0; i{
var n = TREE_OBJ.create(data[i], $ (NODE));
if (onaddnode) onaddnode(n);
}
var firstChild = TREE_OBJ.children(NODE)[0];
if ($(firstChild).attr(' id')==-1)
TREE_OBJ.remove(firstChild);
The problem lies in the TREE_OBJ.create function, which consumes a lot of performance. Change the code to the following:
Code
var children= "";
for (var i=0; i{
children = TREE_OBJ.parseJSON(data[i]);
}
if (children != "")
$(NODE).children('ul').html(children);
var firstChild = TREE_OBJ.children(NODE)[0];
if ($(firstChild) .attr('id')==-1)
TREE_OBJ.remove(firstChild);