Color of Selected Row and fnRowCallback
Color of Selected Row and fnRowCallback
Let say, you want to set the color of selected row by css.
tbody tr.selected {
color: white;
}
Now, sometime you wish to change the color of a row based on some criteria such as salary is greater than 99,999, fnRowCallback is a way to do it.
"fnRowCallback": function(nRow, aData, iDisplayIndex, iDisplayIndexFull) {
if (aData["salary"] > 99999) $(nRow).css('color', 'red');
}
Then if you select this row, the css rule above does not work any more. Is there way to do it? Thanks.
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
It sounds like you have a CSS conflict - you have a row colour for the selection and a row colour for the highlighting. Which do you want to "win"? You need to alter the CSS rules to make sure that one is the one that does show up.
Allan