Disable sorting of a column
Disable sorting of a column
islamelshobokshy
Posts: 99Questions: 20Answers: 1
How to disable sorting of a column and preventing it from being sorted even by sorting other columns. In other words, I just want it to stay fixed as it is.
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Sounds like
columns.orderData
could work. You would have a hidden column with an index then usecolumns.orderData
to have the "fixed" column use the hidden column as the source for sorting. Additionally you might need to useorderFixed
to keep the hidden column as always ordered thus keeping the "fixed" column always ordered..Let us know if this solution works for you.
Kevin
How would you create a hidden column that isn't linked to the actual table so not even the hidden column would be sorted? And also how would you link them? ^^
Forgot to mention that this is what I have, that doesn't work.
Say column 0 is the hidden one, column 0 is the "fixed". This doesn't work either :
I found the answer in the docs, thanks !
https://datatables.net/examples/api/counter_columns.html