I am trying to apply the sorting method to one of the columns in my table. That column is having numerical values and empty values ("--"). I would like to sort the values in ascending and descending manner. And I want all the empty values should go to the bottom of the table in both sorting types.
Could anyone please suggest a custom sorting function to use with react-table-6?
Thank You...
It's crazy that you asked this because I just finished working on this exact problem with the exact same requirements -- lucky you!
This is in TypeScript, but you can remove the types if you want.
The columns:
This is the ranking function:
It's a bit hacky, but it sorts values up to 6 digits. I'm open to optimizations.