CouncilDataProject / CouncilDataProject/cdp-frontend

Tables Sortable By Column

Open
#54 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
TypeScript
Stars
17
Forks
28
PR merge metrics
No merged PRs in 30d

Description

## 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'.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.