Disable user ordering, retain programatic ordering
Disable user ordering, retain programatic ordering
fsld
Posts: 4Questions: 2Answers: 0
In 1.10.6, the option ordering: false
completely disables ordering: it disables click-to-order on column headers, but it also ignores the order
and orderFixed
options, as well as the order()
functions.
I have this code:
// ...
ordering: false,
orderFixed: [[12,'asc'],[1, 'asc']],
paging: false,
info: false,
// ...
And the second line orderFixed
is being ignored.
Is there a way to just disable the 'click-to-order' functionality, but still have the other functions work?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Use the
columns.orderable
option to disable user ordering on a column but retain its programmatic ability to be ordered: http://live.datatables.net/dulayiju/1/edit .This is an area I really need to refine a bit more in DataTables!
Allan
Thanks for the reply, Allan! That is indeed the solution I landed on at the end of the day yesterday. I think my confusion was made even worse by the optional datatables.bootstrap stylesheet, which seems to show the reordering buttons more often than the default. I can't confirm it, though. I wound up copying that css into my own stylesheet and removing some rules to suit my purposes.