views:

19

answers:

1

Hi,

I want to add some class to row when I render a table, sample code:

$("#id").dataTable({
      bProcessing: true,
      sAjaxSource: com.reelroles.path.api.message[component],
      aoColumns: [
        {}, {},
        {
          sWidth: "37px",
          fnRender: function(obj) {
            return "<span>" + myData + "</span>";
          }
        }
      ]
});

In this example I could only control "td" tags, but I want to add some class for "tr" tag based on data that I get in fnRender() in cycle. How I can do it with datatables?

Thanks,

A: 

Looks like in 1.7.3 available new functionality:

http://www.datatables.net/examples/advanced_init/row_callback.html

Alex Ivasyuv