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
columnStatesManager.headerAction : boolean
Determines whether click on the header perform sorting.
indicator
columnStatesManager.indicator : boolean
Determines whether indicator should be visible (for sorted columns).
sortEmptyCells
columnStatesManager.sortEmptyCells : boolean
Determines whether we should sort empty cells.
sortingStates
columnStatesManager.sortingStates : LinkedPhysicalIndexToValueMap
Index map storing sorting states for every column. ColumnStatesManager write and read to/from this element.
Methods
destroy
columnStatesManager.destroy()
Destroy the state manager.
getAllColumnsProperties
columnStatesManager.getAllColumnsProperties() ⇒ object
Get all column properties which affect the sorting result.
getColumnSortState
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.
| Param | Type | Description |
|---|---|---|
| column | number | Visual column index. |
getIndexOfColumnInSortQueue
columnStatesManager.getIndexOfColumnInSortQueue(column) ⇒ number
Get order of particular column in the states queue.
| Param | Type | Description |
|---|---|---|
| column | number | Visual column index. |
getNumberOfSortedColumns
columnStatesManager.getNumberOfSortedColumns() ⇒ number
Get number of sorted columns.
getSortOrderOfColumn
columnStatesManager.getSortOrderOfColumn(searchedColumn) ⇒ string | undefined
Get sort order of column.
| Param | Type | Description |
|---|---|---|
| searchedColumn | number | Visual column index. |
Returns: string | undefined - Sort order (asc for ascending, desc for descending and undefined for not sorted).
getSortStates
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
columnStatesManager.isColumnSorted(column) ⇒ boolean
Get if particular column is sorted.
| Param | Type | Description |
|---|---|---|
| column | number | Visual column index. |
isListOfSortedColumnsEmpty
columnStatesManager.isListOfSortedColumnsEmpty() ⇒ boolean
Get if list of sorted columns is empty.
setSortStates
columnStatesManager.setSortStates(sortStates)
Set all column states.
| Param | Type | Description |
|---|---|---|
| sortStates | Array | Sort states. |
updateAllColumnsProperties
columnStatesManager.updateAllColumnsProperties(allSortSettings)
Update column properties which affect the sorting result.
Note: All column properties can be overwritten by Options#columns option.
| Param | Type | Description |
|---|---|---|
| allSortSettings | object | Column sorting plugin’s configuration object. |