PDA

View Full Version : Calling TreeGrid's setExpanded() not working



sforteza
21 Oct 2009, 12:28 AM
Hello everyone, i have a problem with TreeGrid's setExpanded method, seems it's not working when invoking it after the models had been loaded to the treeStore.

Using GXT Version 2.0.1.

Not working using the following browser:
*IE6
*FF3.0.13
*Chrome 3.0.195.27
also, not working in hosted mode.



for (BaseModelData model : treeStore.getRootItems()) {
treeGrid.setExpanded(model, true);
}

According to some posts it was already fixed but in what version or is there something that i missed?

Thanks in advance ~o)
Francis

francescoNemesi
21 Oct 2009, 9:10 PM
Try this way



for(ModelData c : treeRoot.getChildren()) {
tree.setExpanded(c, true, true);
}

g1_
22 Oct 2009, 2:15 AM
Excuse my ignorance, but what is treeRoot? I don't see any getTreeRoot (or similar) in TreeGrid or TreeStore :-?

I'm currently trying something like this:



for( ModelData c : store.getAllItems() ) {
tree.setExpanded(c, true, true);
}

with no success

sforteza
22 Oct 2009, 2:29 AM
Thanks for the reply francescoNemesi (http://www.extjs.com/forum/member.php?u=2652) but it seems it is still not working; the getChildren() of the treeStore must have a parameter which happens to be the root/parent. The items i wanted to be expanded are the root items not their children. In our case each child of the root items is a leaf node so there is no need for them to be expanded.

sven
22 Oct 2009, 4:00 AM
According to some posts it was already fixed but in what version or is there something that i missed?

Yes there was an issue. It was fixed in GXT 2.0.2