Node 1
Node 2
When all nodes are expanded, it looks like:
Node 1
Unit 1
Component 1
Component 2
Unit 2
Component 3
Node 2
Unit 3
Component 4
We use NodeTreeStore, UnitTreeStore and ComponentTreeStore. They all use proxy URL to get data in XML format.
In the tree, a listener beforeitemexpand is defined to append childNodes based on the node type. For example:
if (node.data.type == 'node') {
var Unitlength = UnitStore.getRootNode().childNodes.length;
for (var j=0; j<=(Unitlength -1); j++){
if (node.get('name') == UnitStore.getRootNode().getChildAt(j).get('node')){
node.appendChild(UnitStore.getRootNode().getChildAt(j));
Unitlength = Unitlength-1;
j = j-1;
}
}
}
Now the problem is when the tree is loaded, sometimes not all the nodes are loaded. If I expand a node that is not loaded, it takes a while, then displays recursive values:
Node 1
Node 1
Node 2
Node 2
How can I get around with this problem? Thank you!
Tree displays recursive values
Aucun commentaire:
Enregistrer un commentaire