changing row color and link color on callback
changing row color and link color on callback
chris.cavage
Posts: 46Questions: 12Answers: 0
I am changing the row color on callback if needed based on this code:
"fnRowCallback": function( nRow, mData, iDisplayIndex ) {
if(mData['return_date'] != undefined || mData['return_date'] != null) {
$(nRow).css('color', 'red');
}
It does NOT apply to links. I know I need to apply a CSS rule to tr a:hover for instance, but how can I target the link in the row based on the code I'm using?
$(nRow+'a:hover').css('color', 'red');
Something like that?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
I would suggest adding a class to the row and then using plain CSS to target that specific class (and any child elements / selectors that you need to use). It will be a lot easier and more maintainable that trying to get CSS like that into JS.
Allan
Great idea. That worked. Thanks.