Multi-Column Sorting with Modifier Key
Holding a modifier key while clicking a header adds that column to the existing sort instead of replacing it. Rows are ordered by the first sorted column, and ties are broken by the next sorted column in priority order. The modifier key is configurable. Developers can also enable multi-sort without any modifier key.
Planned. This page shows the specification from issue #186. The live example, source for every framework and the API reference replace it when the feature ships.
Live example
The employee grid with multiSort=true and multiSortKey='shift'.
Expected behavior
Shift-clicking Salary after sorting Department shows Department as priority 1 and Salary as priority 2. Rows are grouped by Department order with Salary ordering inside each department. When maxSortColumns is reached, adding another column removes the lowest-priority sort. A plain click without the modifier resets the sort to a single column.
Planned API surface
multiSortmultiSortKeyalwaysMultiSortmaxSortColumnssortModelonSortChangedAcceptance criteria
- A modifier-click appends the column to sortModel at the end of the priority list (pending)
- A modifier-click on an already-sorted column advances its direction cycle and keeps its priority (pending)
- When a modifier-click cycles a column to unsorted, the column is removed and the remaining priorities renumber contiguously (pending)
- When alwaysMultiSort=true, a plain click appends instead of replacing (pending)
- When the number of sorted columns would exceed maxSortColumns, the lowest-priority entry is dropped (pending)
- On macOS, the 'ctrl/meta' setting maps to Meta (Cmd) (pending)