How to collapse CellTree nodes programatically?

463 views
Skip to first unread message

Subhrajyoti Moitra

unread,
Dec 12, 2010, 11:24:47 PM12/12/10
to google-we...@googlegroups.com
Hello all,

How do i collapse a CellTree nodes programatically?
I am trying to implement a "collapse all" logic, which will collapse all the open nodes.

How do u identify whether a particular node is open or not?

Any pointer or hints on this regard will be highly appreciated.

Thanks much for the help,

Thanks,
Subhro.
PS: Please dont tell me this is not possible!!!

John LaBanca

unread,
Dec 13, 2010, 10:50:25 AM12/13/10
to google-we...@googlegroups.com
You can get a pointer to the root node using CellTree.getRootTreeNode().  The TreeNode API has methods for closing children and getting child nodes.

The API is a little odd because you call TreeNode.setOpen(index, true) to get the child node.  Its designed this way so TreeNodes can be created lazily, meaning we don't create TreeNodes if the child is closed.  As far as closing all nodes, you really just need to close the top level nodes.  Node state is not remembered in CellTree.

Thanks,
John LaBanca
jlab...@google.com


--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

Subhrajyoti Moitra

unread,
Dec 13, 2010, 11:06:38 AM12/13/10
to google-we...@googlegroups.com
Thanks, a lot John. i will give this a go.

Cheers,
Subhro.
Reply all
Reply to author
Forward
0 new messages