server_side add class to row

server_side add class to row

tweekzillatweekzilla Posts: 1Questions: 0Answers: 0
edited September 2010 in General
Hi everyone

I'm trying to hack together a nice table using the themes.html example and server_side processing. This should be really simple but I need to add class="gradeA" to each of the rows as they come in from the server. I tried doing this but it doesn't work - any help would be much appreciated.

[code]
"fnRowCallback" : function(nRow,aData,iDisplayIndex) {
$('tbody tr').each( function() {
$(this).addClass('gradeA');
});
return nRow;
},
[/code]

Replies

  • jewel03csejewel03cse Posts: 11Questions: 0Answers: 0
    Very simple. Just do as below.

    [code]
    "fnRowCallback" : function(nRow,aData,iDisplayIndex) {

    $(nRow).addClass('class_name');
    return nRow;

    },
    [/code]
This discussion has been closed.