Changing row color and comparing two columns with datatables

Changing row color and comparing two columns with datatables

smksmk Posts: 2Questions: 0Answers: 0
edited September 2012 in General
1) I want to change the row color depending on a column value. Ex if(column[a]=="xx") row color=red else row color=green; I don't know how to do this and
2)I want to implement something like Ex if(column[a]=="xx") hide column[b] else show column[b];

Please someone help me out,

Replies

  • rewenrewen Posts: 74Questions: 2Answers: 0
    For #1 you can try something like this:

    [code]"fnCreatedRow": function( nRow, aData, iDataIndex ) {
    if ( aData[4] == "something" ) {
    $(nRow).addClass('green-row');
    }
    }[/code]
This discussion has been closed.