RowCallBack does not change text color on row?

RowCallBack does not change text color on row?

bazianmbazianm Posts: 6Questions: 4Answers: 0
edited January 2015 in Free community support

Hi,

I have a simple function that is intended to change the foreground color of a row depending on the value of a column. Here's my code:

$(document).ready(function() {
    $('#tblResults').dataTable({
        "fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) {
            switch(aData[3]) {
                case "WWIP":
                    $(nRow).css("color", "yellow");
                    break;

                case "WCSW-I":
                    $(nRow).attr("style", "color:red important");
                    break;

                case "WBW":
                    $(nRow).css("color", "black");
                    break;
            }
            return nRow;
        }
    });
});

The text color is not changing although I have confirmed that the switch is executing (using alerts) and that the code is being executed. I even confirmed that the css color style is changed by going into the HTML portion of firebug. The text is still displaying as black, though.

Any ideas?

This discussion has been closed.