Invalidate() not using data-sort orthogonal data
Invalidate() not using data-sort orthogonal data
Hi,
I'm trying to update a cell's contents and set its data-sort attribute, and after doing so I call invalidate(). The search() then works as expected (i.e. I can then search for updated cell contents), but if I sort the data, it still sorts based on its content, rather than its data-sort attribute.
In the jsfiddle, click the 'click me' button, then sort by the last column, and it should use the number in brackets (which is what it's data-sort is set to), but instead uses the content itself.
My only guess is that I'm either calling invalidate on the wrong thing?
https://jsfiddle.net/24fubkmj/1/
Thanks for any help you can provide!
This question has an accepted answers - jump to answer
Answers
According to the Orthogonal Data HTML5 docs:
I believe this means the attributes need to be in the dom when Datatables initializes. Updated your example to show this:
https://jsfiddle.net/wb9Ln5fk/
Kevin
Ahh! perfect! Knew it would come down to something simple I missed!
Thanks a lot