How to pick up on dynamically adjusted HTML5 data-order attribute

How to pick up on dynamically adjusted HTML5 data-order attribute

nickatfltnickatflt 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

Answers

  • allanallan Posts: 63,689Questions: 1Answers: 10,500 Site admin
    Answer ✓

    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

  • nickatfltnickatflt Posts: 4Questions: 2Answers: 0

    Genius! Thank you. That did the trick.

This discussion has been closed.