A plugin that manages the sorting state. It controls the list of columns that participate in sorting.
Use the following statement to import the plugin:
import { SortingState } from '@devexpress/dx-react-grid';
none
Name | Type | Default | Description |
---|---|---|---|
sorting? | Array<Sorting> | Specifies the applied sorting. | |
defaultSorting? | Array<Sorting> | [] | Specifies initial sorting in the uncontrolled mode. |
columnSortingEnabled? | boolean | true | Specifies whether sorting is enabled for all columns. |
columnExtensions? | Array<SortingState.ColumnExtension> | Additional column properties that the plugin can handle. | |
onSortingChange? | (sorting: Array<Sorting>) => void | Handles sorting changes. |
Describes sorting settings applied to a column.
Field | Type | Description |
---|---|---|
columnName | string | Specifies a column's name to which the sorting is applied. |
direction | 'asc' | 'desc' | Specifies a column's sorting order. |
Describes additional column properties that the plugin can handle.
Field | Type | Description |
---|---|---|
columnName | string | The name of a column to extend. |
sortingEnabled | boolean | Specifies whether sorting is enabled for a column. |
none
Name | Plugin | Type | Description |
---|---|---|---|
sorting | Getter | Array<Sorting> | Applied column sorting. |
isColumnSortingEnabled | Getter | (columnName: string) => boolean | A function used to enable/disable sorting by a column. |
changeColumnSorting | Action | ({ columnName: string, direction?: 'asc' | 'desc' | null, keepOther?: boolean | Array<String>, sortIndex?: number }) => void | Changes the column's sorting direction. keepOther accepts true (keeps existing sorting), a column name array (keeps sorting by specified columns) and false (resets sorting). Set direction to null to cancel sorting by the current column. If sortIndex is omitted, the sorting is added to the end of the sorting list. |