How can a force a redraw even though the data has not changed?
How can a force a redraw even though the data has not changed?
When a certain column gets rendered, it checks if a checkbox on the page is checked. If it is, then then cell gets a background colour. All this works great.
My problem is that I would like to tell datatables to redraw the contents as the flag has been changed.
I have tried
$('#tblOrderMaintLines').DataTable().rows().invalidate().draw();
The data is loaded by :
dTable.row.add([
Col1
,Col2
,etc
]);
I've used invalidate before and it's worked, but this has been when updating the data (add, change or delete). By this I mean, I can delete a row, invalidate the data and the table redraws/renders OK.
This question has an accepted answers - jump to answer
Answers
Hi @Keith_H ,
The best place to do with would be
rowCallback
, as this is called on every draw. That way, the colour will always be current.Cheers,
Colin
Thanks Colin, that worked.