It is posible to order columns independently
It is posible to order columns independently

I wonder if you can display independent information in each column and sort the columns individually, so that if you order one column the others are not affected
thanks in advance
This discussion has been closed.
Answers
That is not a builtin feature of Datatables. It would take a bit of doing but its possible to write your own sorting function. You will probably want to disable the user's ability to order the table with
ordering
then add your own click events to the header. When the header is clicked you can usecolumn().data()
to get the data for the column, you can sort it appropriately then loop through the rows withrows().every()
or maybecells().every()
and rewrite the sorted data for that column.Don't recall this question being asked before so not sure if there are examples. But you could search the forum if you haven't already.
There may be other better options that the developers may suggest.
Kevin