View Full Version : Async TreeGrid expand all children

7 Aug 2009, 12:55 PM
Hi I have an async TreeGrid an I would like to expand all the Children of that Node.

I tried the following

pathtree.setExpanded(be.getModel(), true,true);

but that does not work. Is this because the TreeGrid is Async? Any ideas?


3 Sep 2009, 6:18 AM
I hope my answer is not too late ...

Yes, it's probably because the treeGrid is async : data are not yet loaded when you expand nodes.
Try to add a listener on the grid store and expand nodes on dataChanged event :

pathTree.getTreeStore().addStoreListener(new StoreListener<ModelData>() {
public void storeDataChanged(StoreEvent<ModelData> se) {
for (ModelData model : pathTree.getTreeStore().getRootItems()) {
pathTree.setExpanded(model, true, true);