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?
![Keith_H](https://secure.gravatar.com/avatar/0328d260bcf84a857eb7d527c9c4b831/?default=https%3A%2F%2Fvanillicon.com%2F0328d260bcf84a857eb7d527c9c4b831_200.png&rating=g&size=120)
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.