covalent icon indicating copy to clipboard operation
covalent copied to clipboard

Design Pattern - Data Table: Sort on multiple columns

Open ishatd opened this issue 9 years ago • 5 comments

Sort multiple columns

  • ability to add columns to those selected for sort
  • hooks so we can do the sorting but need indicators in the table of what was sorted
  • ability to remove columns from sort

ishatd avatar Apr 10 '17 16:04 ishatd

@ishatd I'd recommend making an additional separate Feature Request for hiding/removing columns since it's a separate concern from multiple sorting columns

kyleledbetter avatar Apr 12 '17 15:04 kyleledbetter

found another example https://vaadin.com/elements/-/element/vaadin-grid#demos

but even with this one the ux is confusing, i still can't find a clear and easy multi sort ux multi-sort

kyleledbetter avatar May 03 '17 18:05 kyleledbetter

This screen capture shows how this feature is currently implemented in Studio Lite using the PrimeNG data table.

multicolumnsort

  • Clicking on a column header sorts that column ascending
  • Clicking again sorts descending
  • Clicking a third time removes sorting from that column
  • Holding control (or command) while clicking another column adds that column to the sort
  • Clicking a column without holding the control or command key removes sorting from all other columns
  • The sort priority is determined by the order the columns are selected

jdundondev avatar Jul 05 '17 19:07 jdundondev

The event emitted when a column is added or remove from the sort would need to include an array of column sort objects. E.g.

[ { name: "column2", order: "ASC" }, { name: "column1", order: "DESC" }, { name: "column3", order: "ASC" } ]

jdundondev avatar Jul 05 '17 20:07 jdundondev

this is complete but needs implementation see https://design.teradata.com/

owilliams320 avatar Jan 11 '22 16:01 owilliams320