Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data Table - Sortable Table Header #1174

Open
1 task
WilliamHolmes opened this issue Aug 2, 2023 · 0 comments
Open
1 task

Data Table - Sortable Table Header #1174

WilliamHolmes opened this issue Aug 2, 2023 · 0 comments

Comments

@WilliamHolmes
Copy link

Proposal -

It might be a nice idea to allow each table header to decide if it is sortable. Right now, the the able iSortable prop is used an passed down to the table headers.

Description

I have a sortable table (no render passed as prop), but one column is not sortable. As a developer, I should be able to set that column as not sortable without modifying the other columns.

Here is a sortable table, but the tags column is not sortable.

image

Goals / Use cases

This could be achieved by checking the isSortable prop to the headers, ie.

In the header object { key: "tags", "header": "tags", isSortable: false }

In the tableHeader (getHeaderProps) check the isSortable ...

  const isSortable = (header) => {
    return isUndefined(header.isSortable) ? true : header.isSortable;
  }

Acceptance criteria

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant