TreeGrid
A TreeGrid, a Tree combined with a Grid. Must be configured with exactly one TreeColumn
(type: tree), but can also have an arbitrary number of other columns. Most features that can be used with Grid also
works with TreeGrid, except the Group feature.
//<code-header>
fiddle.title = 'Tree grid';
//</code-header>
targetElement.innerHTML = '<p>A basic TreeGrid with minimal configuration:</p>';
const tree = new TreeGrid({
appendTo : targetElement,
height : 400,
data : [
{
id : 1,
name : 'ABBA',
iconCls : 'b-icon fa-users',
born : null,
expanded : true,
children : [
{ id : 11, name : 'Anni-Frid', born : 1945, iconCls : 'b-icon fa-user' },
{ id : 12, name : 'Bjorn', born : 1945, iconCls : 'b-icon fa-user' },
{ id : 13, name : 'Benny', born : 1946, iconCls : 'b-icon fa-user' },
{ id : 14, name : 'Agnetha', born : 1950, iconCls : 'b-icon fa-user' }
]
},
{
id : 2,
name : 'Roxette',
iconCls : 'b-icon fa-users',
born : null,
children : [
{ id : 21, name : 'Per', born : 1959, iconCls : 'b-icon fa-user' },
{ id : 22, name : 'Marie', born : 1958, iconCls : 'b-icon fa-user' }
]
}
],
columns : [
{ type : 'tree', field : 'name', text : 'Name', flex : 1 },
{ type : 'number', field : 'born', text : 'Born', flex : 1, format : null }
]
});Configs
157
Configs
157Common
The store instance or config object that holds the records to be displayed by this TreeGrid. If assigning
a store instance, it must be configured with tree: true.
A store will be created if none is specified.
Content
CSS
DOM
Float & align
Layout
Masking
misc
Misc
Other
State
Tree
Properties
139
Properties
139Common
Class hierarchy
CSS
DOM
Layout
Misc
Other
Scrolling
Selection
State
Tree
Widget hierarchy
Functions
128
Functions
128Feature shortcuts
Collapse a single node.
| Parameter | Type | Description |
|---|---|---|
idOrRecord | String | Number | Model | Record (the node itself) or id of a node to collapse |
Expand a single node.
| Parameter | Type | Description |
|---|---|---|
idOrRecord | String | Number | Model | Record (the node itself) or id of a node to expand |
Expands parent nodes to make this node "visible".
| Parameter | Type | Description |
|---|---|---|
idOrRecord | String | Number | Model | Record (the node itself) or id of a node |
Collapse an expanded node or expand a collapsed. Optionally forcing a certain state.
| Parameter | Type | Description |
|---|---|---|
idOrRecord | String | Number | Model | Record (the node itself) or id of a node to toggle |
collapse | Boolean | Force collapse (true) or expand (false) |
skipRefresh | Boolean | Set to |