cdp-frontend icon indicating copy to clipboard operation
cdp-frontend copied to clipboard

Tables Sortable By Column

Open BrianL3 opened this issue 3 years ago • 0 comments

Use Case

All tables should be sortable by each column. This affects all tables.

Solution

Each table could take a sortByColumn prop. This would be a function, and ask the container to re-order the data by and reset the page to 1. It should probably be optional, since we are unsure if the databases can sortBy everything just yet. Columns should probably have a "yes this column is the active sort" highlight, underline, or something. Column headers may also want to have a up-carat / down-carat to indicate if the data is being sorted in ascending or descending order.

Alternatives

The tables could be somehow integrated into the containers? Or... something, something, Global State (Redux 🤮 ).

Questions

Not all columns will be sortable-by. The solution proposed does not have a way for a column to know if it should show as 'sortable'.

BrianL3 avatar Jun 03 '21 02:06 BrianL3