Material-table: Please add functionality to make multi sort possible

Created on 13 Dec 2018  路  6Comments  路  Source: mbrn/material-table

What is the current behavior?
I can only sort for one column. After I click on a second one, it clears the one before.

What is the use-case or motivation for changing an existing behavior?
That I can use a multiple sort based on year followed by month as well.

feature wontfix

Most helpful comment

+1 Multi-sort is also important for us. Great work.

All 6 comments

For us this as well this is super important.
I hope this gets implemented.

@mbrn Thank you and everyone involved for the hard work, you are great !

Hi @Eli-Goldberg ,

I will apply many more features on table. But nowadays i am very busy and i can reply help-request issues in my limited time. Thanks for your patience

+1 Multi-sort is also important for us. Great work.

@mbrn I needed this feature for a project and have things working great. Wanted to get your take as there are a few ways to go with this. Currently I added a new property called 'sortObject' to data manager which is passed onto table header through table as a prop. It is just a simple object { myFieldA: 'asc', myFieldB: 'desc', .... } . This really takes the place of orderBy and orderDirection, tracking all column sort state. Wasn't sure if you prefer I just replace orderBy and orderDirection with the new 'sortObject' prop as it would handle both single and multi-sort, but might be a breaking change, need to dig a bit further. Also, instead of a table option of 'multiSort' I've just used SHIFT key to track whether user wants current sort to be multi, if event.shiftKey is false it is single sort as usual, even if multi-sort had been active for numerous columns and user performs a new sort without holding SHIFT key then it reverts back to single sort. Any thoughts before I take a pull?

+1 for multi sort on shift click only, I would also enable multi sort by default

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You can reopen it if it required.

Was this page helpful?
0 / 5 - 0 ratings