PDA

View Full Version : [CLOSED][3.0rc1] Async Tree node doesn't expand



Sesshomurai
28 Apr 2009, 3:39 AM
Hi,
I manually add a AsyncTree node to a tree view and call child.expand(true) and the tree view does not expand to the child. opening the parent also does not show the child.

If I open the parent before adding the child, the child appears.

The below code does not work as expected:



parent.appendChild(child);

child.expand(true);


Only when the parent is opened previously is the child visible.

Sesshomurai
28 Apr 2009, 6:55 AM
In addition to this, appending children to nodes in the "append" event callback does not cause the appended nodes to appear.

It should be possible to append to nodes whether or not those nodes are rendered currently. The object model and the rendering should be separate - which I think it is - but perhaps its not working correctly.

Condor
28 Apr 2009, 11:52 PM
I think you don't fully understand how AsyncTreeNode actually works.

An AsyncTreeNode doesn't preload it's children. So not only the rendered presentation of the child nodes, but also the nodes themselves don't exist until the parent node is expanded.

Your problem is that loading an AsyncTreeNode clears all current children (including the ones you added before the expand). If you don't want that you need to set clearOnLoad:false in the TreeLoader config.

Sesshomurai
29 Apr 2009, 5:47 AM
Ahhhh, ok. thanks for the tip. Yes, I don't understand it fully but I appreciate the pointers.