Avoid initial sort when initial data matches ordering anyhow?
Avoid initial sort when initial data matches ordering anyhow?
Karlo
Posts: 34Questions: 10Answers: 0
Hi!
My initial ordering is defined as order: [[0, 'desc']]
and I know that the data that I provide initially comes already in that order. Therefore, can't I avoid the overhead of having DataTables perform an initial sorting? When the user clicks a sortable row later, then it should do the sorting on the client side, though.
Thanks
Karlo
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
You can use
order: []
to stop DataTables from doing any ordering on initialisation.Allan
Ok, but I'd like to see the indicator in the header to show the user that in fact the column is sorted.
I'm afraid that requires DataTables to do the sort. On the plus side, if the data is already ordered, it should be darn fast.
Allan