PDA

View Full Version : Load children of node in Treegrid as expanded by default



Polt
21 Mar 2014, 5:06 PM
Dear community,

I am loading the children of a specific node in a TreeGrid using:

gridStore.load({node: parentNode});
(each child can have children, which means I am actually loading subtrees)


The problem:
Allthough all nodes have properties:
{..., "leaf":false,"expanded":true,"loaded":true}

the are all collapsed by default, but I want them to be all expanded.

Edit: Just one thing to add, I have to click on the [-] of the loaded node to make it expand.

Any ideas?
Thank you in advance!

usavahe
21 Mar 2014, 9:17 PM
You might be able to use expandAll() method after you render the treegrid

Polt
22 Mar 2014, 3:47 AM
Thank you, but it seems that the "render" event is only thrown once when the grid is rendered the first time.

I added a render and afterrender listener to the gridView and gridView.ownerCt but it's not called after adding children to a node using the treestore.load() method.

How can I react to a nodes children beeing updated in the tree panel?

usavahe
22 Mar 2014, 9:47 PM
In that case you should use load event listener.