realtime updating table
realtime updating table

I am updating a table in realtime with the following code
function updateCell(row, col, newVal) {
console.log('updateCell', row, col, newVal);
var prevVal = dt1.cell(row, col).data();
var cellNode = dt1.cell(row, col)
.data(newVal)
.draw(false)
.node();
$(cellNode)
.css({ backgroundColor: newVal > prevVal ? 'green' : 'red' })
.animate({ backgroundColor: 'white' }, 1500);
}
when i do this the focus is changed to the cell that is updated. This is causing me a problem when using inline editing (editor loses focus). Is there a way to update the cell without changing the focus? or a workaround?
R
This discussion has been closed.
Answers
Hi @redisent ,
If you remove the
draw()
it's working for me - see here (click on any cell in the table).Hope that does the trick,
Cheers,
Colin