Dynamically update a cell data-order without losing bound action
Dynamically update a cell data-order without losing bound action
I have a complex table that uses other jquery scripts to modify (i.e. make a chekbox to a slider on/off widget).
I click the widget which changes the value from True or False
so i grab the object
$('#tdid').data('order', selected);
where selected is 'True' or 'False'
Now I find I can not sort properly by that column.
I have tried
table.row($('#tdid').parent('tr')).invalidate().draw();
seems to have no effect. Using the dom inspect on Chrome, i see that the data-order attribute has never changed, yet if I call $('#tdid').data('order') i get the correct value.
Could someone please give me a full example on how to change the order of a cell dynamically without affecting any code/bound scripts inside the cell?
Thanks!