PDA

View Full Version : [solved?]Tree load and expand



Lobos
21 Aug 2009, 4:14 PM
Not sure if this is the best way to do this, but I had a situation where I needed to add a node to the tree and then reload it (I know not essential, and I will prolly change to make all work on the client) and I found that I was getting two nodes show up because Expand() on an unloaded node loads it as well so you get two loads...

Anyways maybe this can help someone out....


Ext.Ajax.request({
url: '?v=admin.add_Node&dt=1',
params: params,
success: function(){
var treeLoader = Ext.getCmp('nodeTree').getLoader();



if(!node.loaded){
node.expand();
} else {
treeLoader.load(node);
node.expand();
}

},
failure: function(){

}
});