GridState
Configs
1
Configs
1The properties of this settings object controls how grid is restored from state data.
To disable state restoration for unconfigured columns:
const grid = new Grid({
stateSettings : {
restoreUnconfiguredColumns : false
}
});
| Parameter | Type | Description |
|---|---|---|
restoreUnconfiguredColumns | Boolean | Determines whether to restore columns from the state that are not explicitly defined in the grid configuration. |
Properties
4
Properties
4Class hierarchy
Other
The properties of this settings object controls how grid is restored from state data.
To disable state restoration for unconfigured columns:
const grid = new Grid({
stateSettings : {
restoreUnconfiguredColumns : false
}
});
| Parameter | Type | Description |
|---|---|---|
restoreUnconfiguredColumns | Boolean | Determines whether to restore columns from the state that are not explicitly defined in the grid configuration. |
State
Gets or sets grid's state. Check out GridState mixin for details.
Events
2
Events
2Fired before state is applied to the source. Allows editing the state object or preventing the operation.
// Adding a listener using the "on" method
gridState.on('beforeStateApply', ({ state }) => {
});| Parameter | Type | Description |
|---|---|---|
state | GridStateInfo | State object config |
Fired before state is saved by the StateProvider. Allows editing the state object or preventing the operation.
// Adding a listener using the "on" method
gridState.on('beforeStateSave', ({ state }) => {
});| Parameter | Type | Description |
|---|---|---|
state | GridStateInfo | State object config |
Event handlers
2
Event handlers
2Called before state is applied to the source. Allows editing the state object or preventing the operation.
new GridState({
onBeforeStateApply({ state }) {
}
});| Parameter | Type | Description |
|---|---|---|
state | GridStateInfo | State object config |
Called before state is saved by the StateProvider. Allows editing the state object or preventing the operation.
new GridState({
onBeforeStateSave({ state }) {
}
});| Parameter | Type | Description |
|---|---|---|
state | GridStateInfo | State object config |
Typedefs
3
Typedefs
3An object which encapsulates a column's saved state.
| Parameter | Type | Description |
|---|---|---|
id | String | The column's id. |
type | String | The column's type. |
hidden | Boolean | Whether the column is hidden. |
region | String | The region of the column. |
locked | String | The locked state of the column. |
text | String | The header text of the column. |
field | String | The field name of the column. |
parentId | String | The id of the parent column, if this column is a child of another. |
width | Number | The width of the column. |
flex | Number | The flex of the column. |
collapsed | Boolean | Whether the column is collapsed. |
An object which encapsulates a Grid's saved state.
| Parameter | Type | Description |
|---|---|---|
columns | ColumnState[] | |
rowHeight | Number | |
scroll | Object | |
scroll.scrollLeft | Number | |
scroll.scrollTop | Number | |
selectedRecords | String[] | Number[] | |
style | String | |
selectedCell | String | |
treeGroupLevels | String[] | |
store | Object | |
store.sorters | Sorter[] | |
store.groupers | Grouper[] | |
store.filters | CollectionFilterConfig[] | |
store.collapsedGroups | String[] | |
subGrids | Object<String, SubGridState> |
An object which encapsulates a SubGrid's saved state.
| Parameter | Type | Description |
|---|---|---|
width | Number | The width of the sub grid. |
flex | Number | The flex of the sub grid. |
collapsed | Boolean | Whether the sub grid is collapsed. |