Why doesn't the row get the class added to it?
Why doesn't the row get the class added to it?
I have this datatable That I want to have different row color for each row, I am using the following code but the CSS datatables background class always replaces my own background class
var oTableNE = $('#tabelNE').dataTable({
"fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) {
// Bold the grade for all 'A' grade browsers
if ( aData[8] == "Submitted" )
{
$(nRow).addClass("submittedColor");
console.log("Change Color by adding CSS Class" + " nRow " +nRow + " " +aData[0] + " | " +aData[1] + " | " +aData[2]+ " | " +aData[8]);
}else{
console.log("Don't Change Color" + " nRow " +nRow + " " +aData[0] + " | " +aData[1] + " | " +aData[2]+ " | " +aData[8]);
}
}
});
var oTableNE = $('#tabelNE').dataTable({
"fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) {
// Bold the grade for all 'A' grade browsers
if ( aData[8] == "Submitted" )
{
$(nRow).addClass("submittedColor");
console.log("Change Color by adding CSS Class" + " nRow " +nRow + " " +aData[0] + " | " +aData[1] + " | " +aData[2]+ " | " +aData[8]);
}else{
console.log("Don't Change Color" + " nRow " +nRow + " " +aData[0] + " | " +aData[1] + " | " +aData[2]+ " | " +aData[8]);
}
}
});
This discussion has been closed.
Replies