Skip to content

ColumnStatesManager

Description

Initializes the column states manager with the Handsontable instance and registers the sorting states index map under the given map name.

Members

headerAction

Source code

columnStatesManager.headerAction : boolean

Determines whether click on the header perform sorting.

indicator

Source code

columnStatesManager.indicator : boolean

Determines whether indicator should be visible (for sorted columns).

sortEmptyCells

Source code

columnStatesManager.sortEmptyCells : boolean

Determines whether we should sort empty cells.

sortingStates

Source code

columnStatesManager.sortingStates : LinkedPhysicalIndexToValueMap

Index map storing sorting states for every column. ColumnStatesManager write and read to/from this element.

Methods

destroy

Source code

columnStatesManager.destroy()

Destroy the state manager.

getAllColumnsProperties

Source code

columnStatesManager.getAllColumnsProperties() ⇒ object

Get all column properties which affect the sorting result.

getColumnSortState

Source code

columnStatesManager.getColumnSortState(column) ⇒ object | undefined

Get sort state for particular column. Object contains column and sortOrder properties.

Note: Please keep in mind that returned objects expose visual column index under the column key.

ParamTypeDescription
columnnumberVisual column index.

getIndexOfColumnInSortQueue

Source code

columnStatesManager.getIndexOfColumnInSortQueue(column) ⇒ number

Get order of particular column in the states queue.

ParamTypeDescription
columnnumberVisual column index.

getNumberOfSortedColumns

Source code

columnStatesManager.getNumberOfSortedColumns() ⇒ number

Get number of sorted columns.

getSortOrderOfColumn

Source code

columnStatesManager.getSortOrderOfColumn(searchedColumn) ⇒ string | undefined

Get sort order of column.

ParamTypeDescription
searchedColumnnumberVisual column index.

Returns: string | undefined - Sort order (asc for ascending, desc for descending and undefined for not sorted).

getSortStates

Source code

columnStatesManager.getSortStates() ⇒ Array<object>

Queue of sort states containing sorted columns and their orders (Array of objects containing column and sortOrder properties).

Note: Please keep in mind that returned objects expose visual column index under the column key.

isColumnSorted

Source code

columnStatesManager.isColumnSorted(column) ⇒ boolean

Get if particular column is sorted.

ParamTypeDescription
columnnumberVisual column index.

isListOfSortedColumnsEmpty

Source code

columnStatesManager.isListOfSortedColumnsEmpty() ⇒ boolean

Get if list of sorted columns is empty.

setSortStates

Source code

columnStatesManager.setSortStates(sortStates)

Set all column states.

ParamTypeDescription
sortStatesArraySort states.

updateAllColumnsProperties

Source code

columnStatesManager.updateAllColumnsProperties(allSortSettings)

Update column properties which affect the sorting result.

Note: All column properties can be overwritten by Options#columns option.

ParamTypeDescription
allSortSettingsobjectColumn sorting plugin’s configuration object.