PDA

View Full Version : TreePanel problem: node with no children must be a leaf after AJAX load



ReBorn
21 Jun 2010, 3:36 AM
Hi, all!

I'm trying to mark node as leaf in TreePanel, if server response of AJAX "load children" call is equal to "[]" (empty array). For now I have no luck with this, even after this listener:


load: function(tree, node, response ) {
if(response.responseText.length == 0 || response.responseText == '[]' || response.responseText == '[{}]') {
node.removeAll();
node.leaf = true;
node.allowChildren = false;
node.getUI().hide();
node.getUI().show();
}
}

Maybe I'm missing something in the documentation or even going to the wrong direction?

All my nodes (even with zero children) are folders =(