Nested Sorting of React Table V7

88 Views Asked by At

I am using React Table V7. I want the table to be always sorted by a specific column (Col A). Then if I click on any other column (Col B), it will sort table by column B with 2nd priority (with col A as first priority) Anyone knows how to do it?

I found sortedIndex of column which represents like:

sortedIndex = -1 means table is not sorted by this column sortedIndex = 0 means table is sorted by this col with highest priority (0) sorted Index = 1 means table is sorted by this col with second highest priority (1) and so on But I can't set sortedIndex of any column and make it persist. When I click on other column it destroys previously set sortedIndex values. In angular JS (UI Data Grid): this is done by adding grouping: { groupPriority: 1 }, sort: { priority: 1, direction: 'asc' } in the column definitions.

0

There are 0 best solutions below