GridState

Configs

1

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
    }
});
ParameterTypeDescription
restoreUnconfiguredColumnsBoolean

Determines whether to restore columns from the state that are not explicitly defined in the grid configuration.

Properties

4

Class hierarchy

isGridState: Boolean= truereadonly
Identifies an object as an instance of GridState class, or subclass thereof.
isGridState: Boolean= truereadonlystatic
Identifies an object as an instance of GridState class, or subclass thereof.

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
    }
});
ParameterTypeDescription
restoreUnconfiguredColumnsBoolean

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

Fired 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 }) => {

});
ParameterTypeDescription
stateGridStateInfo

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 }) => {

});
ParameterTypeDescription
stateGridStateInfo

State object config

Event handlers

2

Called before state is applied to the source. Allows editing the state object or preventing the operation.

new GridState({
    onBeforeStateApply({ state }) {

    }
});
ParameterTypeDescription
stateGridStateInfo

State object config

Called before state is saved by the StateProvider. Allows editing the state object or preventing the operation.

new GridState({
    onBeforeStateSave({ state }) {

    }
});
ParameterTypeDescription
stateGridStateInfo

State object config

Typedefs

3

An object which encapsulates a column's saved state.

ParameterTypeDescription
idString

The column's id.

typeString

The column's type.

hiddenBoolean

Whether the column is hidden.

regionString

The region of the column.

lockedString

The locked state of the column.

textString

The header text of the column.

fieldString

The field name of the column.

parentIdString

The id of the parent column, if this column is a child of another.

widthNumber

The width of the column.

flexNumber

The flex of the column.

collapsedBoolean

Whether the column is collapsed.

An object which encapsulates a Grid's saved state.

ParameterTypeDescription
columnsColumnState[]
rowHeightNumber
scrollObject
scroll.scrollLeftNumber
scroll.scrollTopNumber
selectedRecordsString[] | Number[]
styleString
selectedCellString
treeGroupLevelsString[]
storeObject
store.sortersSorter[]
store.groupersGrouper[]
store.filtersCollectionFilterConfig[]
store.collapsedGroupsString[]
subGridsObject<String, SubGridState>

An object which encapsulates a SubGrid's saved state.

ParameterTypeDescription
widthNumber

The width of the sub grid.

flexNumber

The flex of the sub grid.

collapsedBoolean

Whether the sub grid is collapsed.