WarUI

Configurable Tri-State Sort Cycle

GRID-A09-F02P0baselinePlanned

By default, clicking a header cycles through ascending, then descending, then unsorted. Developers can override this order globally or per column, for example to start descending or to remove the unsorted state. The unsorted state restores the original data order.

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

A sales grid with Region, Rep and Revenue columns. The global sortingOrder is ['asc','desc',null].

Expected behavior

With the default cycle, the third click on a header restores the original row order. Revenue with ['desc','asc'] starts descending and alternates between the two directions without an unsorted step. The 'next state' indicator updates after each click.

Planned API surface

sortingOrdercolumns[].sortingOrdersortModelonSortChanged

Acceptance criteria

  • The default cycle is asc, desc, none, then asc again (pending)
  • The unsorted state restores the original insertion order of the rows (pending)
  • A column-level sortingOrder overrides the global value (pending)
  • A cycle without null never produces the unsorted state from clicks (pending)
  • An invalid sortingOrder, such as an empty array or unknown tokens, logs a developer warning and falls back to the default cycle (pending)