Sorting
The sorting feature provides methods and state for sorting table rows by one or more columns. These properties are available on the table instance when using the sorting feature. See the sorting guide for usage examples and configuration details.
| Prop | Type |
|---|---|
Returns the row model for the table before any sorting has been applied. | () => { |
Returns the row model for the table after sorting has been applied. | () => { |
Resets the sorting state to initialState.sorting, or true can be passed
to force a default blank state reset to []. | ( |
Sets or updates the state.sorting state. | ( |
Type
() => {
flatRows: Row[]
rows: Row[]
rowsById: Record
}
Description
Returns the row model for the table before any sorting has been applied.
Type
() => {
flatRows: Row[]
rows: Row[]
rowsById: Record
}
Description
Returns the row model for the table after sorting has been applied.
Type
(
defaultState?: boolean,
) => void
Description
Resets the
sorting state to initialState.sorting, or true can be passed
to force a default blank state reset to [].Type
(
updater:
| T
| ((old: T) => T),
) => void
Description
Sets or updates the
state.sorting state.