GWT CellTree expand/collapse all

1,400 views
Skip to first unread message

Sven

unread,
Aug 4, 2011, 7:46:51 AM8/4/11
to Google Web Toolkit
Hi there,

is there a simple way to just expand or collapse all treenodes?
Or do i really have iterate through each one and use setChildOpen?

Hope someone can help :)

at.d...@gmail.com

unread,
Jan 24, 2012, 6:20:19 AM1/24/12
to google-we...@googlegroups.com

public void TreeNodeExpand(TreeNode node) {

for (int i = 0; i < node.getChildCount(); i++) {

if (!node.isChildLeaf(i)) {

TreeNodeExpand(node.setChildOpen(i,

true));

}

}

}

public void TreeNodeCollapse(TreeNode node) {

for (int i = 0; i < node.getChildCount(); i++) {

if (!node.isChildLeaf(i)) {

TreeNodeExpand(node.setChildOpen(i,

false));

}

}

}

Reply all
Reply to author
Forward
0 new messages