How to disable "sorting by nothing" of the third click on column header?
How to disable "sorting by nothing" of the third click on column header?

Hello. I don't know if this is possible to do, but in my case this causes a problem.
Normal behaviour about Datatable ordering is as follow.
- First click on column header, sort ascending by that column
- Second click on column header, sort descending by that column
- Third click on column header, no sorting at all occur. If using server side processing, no
order[0]
element is posted to the server.
How can I avoid third click behaviour?
For instance, I need:
- First click on column header, sort ascending by that column
- Second click on column header, sort descending by that column
- Third click on column header, sort ascending by that column
- Fourth click on column header, sort descending by that column
- And so on
Is that possible? Or maybe a workaround?
thanks
Jaime
This question has an accepted answers - jump to answer
Answers
The
columns.orderSequence
docs have the answer. Use this to revert to the default Datatalbes 1.x behavior:Kevin