Peter Hawkes
4 Aug 2007, 7:03 AM
Hi,
I have a tree menu that works with a 'nested set model' backend. I have managed to get it to sort, add, edit and delete to unlimited depth categories. What I can't seem to figure out is out to fire an event when all nodes have been loaded.
Due to sending my full tree back to the server on DnD and any node created or deleted I need all nodes opened which I am doing when the page loads like so:
var root = new Tree.AsyncTreeNode({
text: 'Categories',
draggable:false,
id:1
});
tree.setRootNode(root);
tree.render();
root.expand();
tree.expandAll();
So that does what I want, opens every node via my loader. Is there an event to check when the entire tree has expanded, so when tree.expandAll() has finished?
Obviously this:
root.on("load",function(){
alert("tree loaded");
});
fires on every node that finishes loading.
I can't have my users doing anything to the tree until its fully loaded, otherwise it breaks the nested set model (MySQL). Apologies if this is a simple question, I am very new to ExtJS and have had to jump into the deep end a little.
Thanks
Peter
I have a tree menu that works with a 'nested set model' backend. I have managed to get it to sort, add, edit and delete to unlimited depth categories. What I can't seem to figure out is out to fire an event when all nodes have been loaded.
Due to sending my full tree back to the server on DnD and any node created or deleted I need all nodes opened which I am doing when the page loads like so:
var root = new Tree.AsyncTreeNode({
text: 'Categories',
draggable:false,
id:1
});
tree.setRootNode(root);
tree.render();
root.expand();
tree.expandAll();
So that does what I want, opens every node via my loader. Is there an event to check when the entire tree has expanded, so when tree.expandAll() has finished?
Obviously this:
root.on("load",function(){
alert("tree loaded");
});
fires on every node that finishes loading.
I can't have my users doing anything to the tree until its fully loaded, otherwise it breaks the nested set model (MySQL). Apologies if this is a simple question, I am very new to ExtJS and have had to jump into the deep end a little.
Thanks
Peter