A hierarchical tree widget bound directly to a @link {@link TreeStore}.
TreePanel
contains no child widgets, rather, the tree is rendered based on the models contained in the tree store. Once bound, the tree will remain in sync with the bound tree store.
The text of each node can be specified in a couple of different ways. First, a display property can be set using {@link #setDisplayProperty(String)}. The is useful when the item's text is contained within the model's data. Second, a model string provider can be specified using {@link #setLabelProvider(ModelStringProvider)}.
With state enabled, TreePanel will save and restore the expand state of the nodes in the tree. A
ModelKeyProvider
must specified with the
TreeStore
this tree is bound to. Save and restore works with both local, and asynchronous loading of children.
- Events:
- BeforeExpand : TreePanelEvent(treePanel, item)
Fires before a node is expanded. Listeners can cancel the action by calling {@link BaseEvent#setCancelled(boolean)}.
- treePanel : the source tree
- item : this
- BeforeCollapse : TreePanelEvent(treePanel, item)
Fires before a node is collapsed. Listeners can cancel the action by calling {@link BaseEvent#setCancelled(boolean)}.
- treePanel : the source tree
- item : this
- Expand : TreePanelEvent(treePanel, item)
Fires after a node has been expanded.
- treePanel : the source tree
- item : this
- Collapse : TreePanelEvent(treePanel, item)
Fires after a node is collapsed.
- treePanel : the source tree
- item : this
- BeforeCheckChange : TreePanelEvent(treePanel, item)
Fires before a node's check state is changed. Listeners can cancel the action by calling {@link BaseEvent#setCancelled(boolean)}.
- treePanel : the source tree
- item : this
- checked : the checked state.
- CheckChange : TreePanelEvent(treePanel, item)
Fires after a item's check state changes.
- treePanel : the source tree
- item : this
- checked : the checked state.
- CheckChanged : CheckChangeEvent(provider, checkedeSelection)
Fires after the tree's overall checked state changes.
- provider : the source tree
- checkedSelection : the tree checked item
@param < M> the model type