PDA

View Full Version : Load Root Node in Tree



Zyclops
15 Oct 2007, 10:50 PM
Is there a way to dynamically load the root node of a tree, currently I have:


var tree = new Tree.TreePanel({
el:'org-tree',
autoScroll:true,
animate:true,
selModel: false,
containerScroll: true,
loader: new Tree.TreeLoader({
dataUrl:'/access/tree_data/' + this.emplid,
preloadChildren: true
}),
root: new Tree.AsyncTreeNode({draggable:false,expanded:false,id:'1'})
});


Which statically loads the root node and the dynamically loads it's children, I'd like to just make a call and use that as the entire tree, but I haven't come across any examples that do that.

In case you we're wondering, I need to pass specific class settings which depend on the rails application that it queries the tree from.

mabello
19 Mar 2008, 4:34 AM
Maybe this extension suites your needs

http://extjs.com/forum/showthread.php?t=26510

Hope this helps

Emmster
19 Mar 2008, 6:25 AM
I might not understand your question correctly, but would something like this work?


var root = new Ext.tree.AsyncTreeNode({draggable:false,expanded:false,id:'1'});
tree.setRootNode(root);