Sorting wiping out row background colors changed in rowCallBack
Sorting wiping out row background colors changed in rowCallBack
mmealman
Posts: 1Questions: 1Answers: 0
I'm running Datatables 1.10 and using the below code to change the row background colors which is working really well, however sorting is over riding the changes. I think this is being over written by an entry under jquery.dataTables.css but I haven't had any luck figuring out which entry I need to remove to stop sorting from nuking my background-color. Does anyone know which CSS entries I need to nuke?
"rowCallback": function( row, data ) {
var action = data[0];
var $nRow = $(row);
if(action == "1") {
$nRow.css({"background-color":"green"});
} else if(action == "-1") {
$nRow.css({"background-color":"red"});
} else {
$nRow.css({"background-color":"white"});
}
},
This discussion has been closed.