material-table
material-table copied to clipboard
Multiple sorting
Like someone suggested back in 2019, is it possible to have multiple sorting in the material-table?
#541 (closed)
Example: (user: cooperate) So i sort column A in this way
Col A | Col B
10 E
10 D
10 C
12 A
13 B
13 Z
13 A
And then enable "secondary sort" and secondary sort Col B in this way
Col A | Col B
10 C
10 D
10 E
12 A
13 A
13 B
13 Z
Thx
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.
as a workaround, you can implement sorting by two properties using defaultSort and customSort on a column:
columns = {[{
defaultSort: "asc",
customSort: (a, b) =>
a.foo.localeCompare(b.foo) || a.bar.localeCompare(b.bar),
...
}]}