fnRedraw does not seem to redraw

fnRedraw does not seem to redraw

penguin020penguin020 Posts: 1Questions: 0Answers: 0
edited June 2012 in General
I have a DataTable with a status column. I wish the status to change color based on the time the row has been in the status. So, if the status is "waiting", I want it to turn red after 1 minute.

I have the date/time the status was set in another data field of the column data, so, I can use fnRender to render the column in a particular color based on the "age" of the status.

e.g.
[code]
"fnRender": function (oObj, val)
{
var getTimeDiff = function (t1, t2) { return return (t1.getTime() - t2.getTime()) / (60 * 1000); };
var localTime = new date(); //Get current time
if (getTimeDiff(localTime, oObj.aData[15]) <= 1.0) return "new"; else return "old";
}
[/code]

So, my problem is that I need to periodically update the color of the status, even though the column data has not changed.

fnDraw() does not seem to re-render the columns. I assume this is because the underlying data has not changed.

Any ideas?
This discussion has been closed.