O'Reilly logo

ExtGWT Rich Internet Application Cookbook by Odili Charles Opute

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Building trees with checkbox selection

Sometimes you need more than to just be able to navigate a hierarchy of nodes in a tree, say maybe to select one or more nodes. By default, the TreePanel object allows selection of only a single node at a time; we can configure it to allow multiple node selection by passing SelectionMode.MULTI to tree.getSelectionModel().SetSelectionMode().

Here, we want to use the more flexible and more user-friendly checkbox selection that renders tree nodes with a checkbox, allowing the user to check/uncheck as many nodes as possible at any time, depending on the combination of the values given to tree.setCheckNodes() and tree.setCheckStyle(). The following screenshot displays a tree with a checkbox for each node:

How to ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required