WarUI

Sorting groups and rows inside groups

GRID-A16-F16P1baselinePlanned

Groups can be sorted by key or by an aggregate value, independently of how leaf rows are sorted within each group. This allows views such as 'regions by highest revenue, orders by date'.

Planned. This page shows the specification from issue #196. The live example, source for every framework and the API reference replace it when the feature ships.

Live example

Grouped by Country. Groups are sorted by Revenue sum descending, and leaves by Date descending.

Expected behavior

Group order and leaf order change independently. Clicking a grouped column's header sorts the groups by key.

Planned API surface

options.grouping.groupSort [{column, by: key|aggregate, direction}]options.sortevents.sortChanged

Acceptance criteria

  • Sorting groups by aggregate orders siblings by the computed aggregate at every level. (pending)
  • Leaf sorting never moves rows across groups. (pending)
  • The sort is stable for equal keys. (pending)
  • Clicking a grouped column header cycles the group key sort. (pending)