react-bootstrap-table2 icon indicating copy to clipboard operation
react-bootstrap-table2 copied to clipboard

Alternate sort order for a column

Open trey325 opened this issue 8 years ago • 2 comments

Is it possible to specify an alternate sort order for a column? Rather than sort alphanumerically, I would like to sort by a semantic order (like having "Critical" sort higher than "Low" for example). Datatables.js handles this by allowing a column to use another, hidden column to handle sorting. I see that custom sort functions are allowed, but it does not seem easy to pass anything other than the column value itself in.

trey325 avatar Aug 29 '18 16:08 trey325

@jbcksfrt the answer for me is custom the sort function. I understand it's a callback function however, you can still use it as higher order function so that you can pass something into the sort callback function.

I won't implement this feature currently, so please use custom sort. thanks

AllenFang avatar Sep 01 '18 05:09 AllenFang

OK, I will give it a try using the custom sort function. I guess I will try to pass something in explicitly or use a member variable to link labels to sort order integers.

trey325 avatar Sep 01 '18 11:09 trey325