I need to set the background of the cell depending by the value of the associated data.
in my tbale I've set the 'createdCell' event:
{
"targets": 5,
"createdCell": function (td, cellData, rowData, row, col) {
if (tipoRecord === 'Ricevuti' && rowData.Gestore !== '') {
$(td).css('background-color', rowData.GestoreColor);
}
}
}
When I update the value of the cell with row.data(newdata), other values of the row are changed correctly, but the 'createdCell' event is not called, so the Background doesn't change.
How can I set the background on data update?