View Full Version : TreePanel node added listener issue

13 Jan 2011, 1:59 PM

We have a Ext.tree.TreePanel which is loaded from XmlTreeLoader and the listener on treePanel 'append' or 'load' don't work as expected. It fires only once. This is a bug to me.

Is there an event that get's fired for each node when its added to the tree?

We need this because in event processAttributes method of XmlTreeLoader, attr does not have tree node.id yet as it is not created.


14 Jan 2011, 12:06 AM
'load' is fired for every branch that is loaded, but an XmlTreeLoader builds the entire tree first and then loads it, which will cause only one load event.

Why do you need the node id? You can get the node id in the createNode method or you could generate one yourself in processAttributes.

15 Jan 2011, 10:56 AM
Thanks Condor for the information. Our tree is huge/ deep so we need to store a node attribute - tree node key value pair and viceversa in a hashmap so look up is faster and efficient for cross selection (visually show too). So when the tree is being created i.e. node is added we want to build this hashmap in the listener.

Looks like we have to use afterrender to scan through the tree to build the hashmap?

15 Jan 2011, 11:00 AM
BTW Even with XmlTreeLoader node 'append' event should be fired for each node added right?