Tree
Feature
Feature that makes the grid work more like a tree. Included by default in TreeGrid. Requires exactly one TreeColumn among grids columns. That column will have its renderer replaced with a tree renderer that adds padding and icon to give the appearance of a tree. The original renderer is preserved and also called.
This feature is disabled by default. When enabled, the feature cannot be disabled during runtime.
Keyboard shortcuts
This feature has the following default keyboard shortcuts:
| Keys | Action | Action description |
|---|---|---|
| Space | toggleCollapseByKey | When focus on a parent node, this expands or collapses its children |
| ArrowRight | expandIfSingleColumn | Expands a focused parent node if grid consist of one column only |
| Shift+ArrowRight | expandByKey | Expands a focused parent node |
| ArrowLeft | collapseIfSingleColumn | Collapses a focused parent node if grid consist of one column only |
| Shift+ArrowLeft | collapseByKey | Collapses a focused parent node |
For more information on how to customize keyboard shortcuts, please see our guide
See also
- TreeGrid - The tree grid view
- TreeColumn - The tree column type
- TreeGroup - Group flat data into a tree
Configs
Configs are options you supply in a configuration object when creating an instance of this class-
Expand parent nodes when clicking on their cell
Has a corresponding runtime expandOnCellClick property.
-
keyMap : Object<String, KeyMapConfig>
See Keyboard shortcuts for details
-
Show or hide tree lines
Has a corresponding runtime treeLines property.
Properties
Properties are getters/setters or publicly accessible variables on this class-
Identifies an object as an instance of Tree class, or subclass thereof.
-
Expand parent nodes when clicking on their cell
Has a corresponding expandOnCellClick config.
-
Show or hide tree lines
Has a corresponding treeLines config.
-
Identifies an object as an instance of Tree class, or subclass thereof.
Functions
Functions are methods available for calling on the class-
onElementClick( )private
Called when user clicks somewhere in the grid. Expand/collapse node on icon click.
-
toggleCollapseByKey( )private
Called on key down in grid. Expand/collapse node on Space
-
Collapse all nodes. This function is exposed on Grid and can thus be called as
grid.collapseAll() -
Expand all nodes. This function is exposed on Grid and can thus be called as
grid.expandAll()