Server-Side Processing, Cell-Specific CSS
Server-Side Processing, Cell-Specific CSS
I'm loading my data table server-side, and I need to flag specific values. I see that you can set the row css in the returned aaData, but I'm having trouble finding anything about css for a specific cell. Is it possible to do it from the server? Otherwise, I'm going to need some ugly javascript.
This discussion has been closed.
Replies
[code]
"fnRowCallback": function (nRow, aData, iDisplayIndex, iDisplayIndexFull) {
ColorCells(nRow,aData);
return nRow;
}
function ColorCells(nRow,aData){
var cell = nRow.cells[14];
var cellValue = aData[14];
if (cellValue > 10)
$(cell).addClass('good');
else if (cellValue === 0)
$(cell).addClass('warning');
}
[/code]