mirror of
https://github.com/gosticks/react-table.git
synced 2025-10-16 11:55:36 +00:00
1.1 KiB
1.1 KiB
useColumnOrder
- Plugin Hook
- Optional
useColumnOrder is a plugin hook that implements basic column reordering. As columns are reordered, their header groups are reverse-engineered so as to never have orphaned header groups.
Table Options
The following options are supported via the main options object passed to useTable(options)
initialState.columnOrder: Array<ColumnId>- Optional
- Defaults to
[] - Any column ID's not represented in this array will be naturally ordered based on their position in the original table's
columnstructure
Instance Properties
The following values are provided to the table instance:
-
setColumnOrder: Function(updater: Function | Array<ColumnId>) => void- Use this function to programmatically update the columnOrder.
updatercan be a function or value. If afunctionis passed, it will receive the current value and expect a new one to be returned.