Replies: 1 comment 1 reply
-
I should probably add more to the sorting docs. You might not actually need a custom You might want to just try out changing the If you do need to write a custom sortingFn, there's more info in the TanStack Sorting Docs. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Currently I couldn't find any example on how to write and what to return in the "sortingFn" property of a column (https://www.material-react-table.com/docs/guides/sorting#change-sorting-function-per-column).
like for now, I need the sorting function where the asc and desc will work on only non empty cells. Like, if rowA.getValue(columnId) == "", then return -1.... means no matter what(asc or desc), the empty cells (empty strings) will be always in the last. Can anyone help how to write it in "sortingFn"? Also how to know in sortingFn that currently which mode is activated?(mode : desc or asc or no sort?)
Beta Was this translation helpful? Give feedback.
All reactions