Sort by single column
Add support to sort table data by columns.
- A user clicks on the column heading to pick the column for sort (
asc
initially) - If the column is sorted by
asc
, toggle direction todesc
- If column direction is
desc
, clear sort preference (not sorted)
The sort indicator should be displayed in the column header. The <Table
will receive an array of sort options:
[ { "field": "asc" }, { "field": "desc" } ]
Add onOrderBy: (columnKey, direction)
event handler and trigger this event.
Sorting must not be included in column preferences, it is a separate "order"
prop managed by HOC:
{ "field": "asc" | "desc" }
Multiple sort will be implemented in grin-global-server#23 (closed).