How to pick up on dynamically adjusted HTML5 data-order attribute
How to pick up on dynamically adjusted HTML5 data-order attribute
nickatflt
Posts: 4Questions: 2Answers: 0
I've discovered that when you change the data-order attribute in an initialized DataTable, even if you call draw() on the table after changing the attribute, DataTables doesn't recognize the change when you try sorting the column. Is there another way to do this so that when the data-order attribute changes dynamically, the column can be properly sorted?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
You need to invalidate the cached data that DataTables stores about the row using
row().invalidate()
. Having DataTables read the data from the DOM (i.e. no cache) would be horrible from a performance point of view.Allan
Genius! Thank you. That did the trick.