title: How to apply Css class to a row using datatables.js?
body: <p>I have retrieved table from SQL procedure contains column with name of class that is to be applied on that particular row.<br>
  However that table is passed to datatable.js as a data-source.
  Now with my code, specified class is getting applied to only one cell: in <code>fnRowCallback()</code> function.
  I want is to apply that class to entire row.</p>
  
  <h2>Here is my <code>javascript</code> code:</h2>
  
  <pre><code>var dataSet = JSON.parse("[" + a.toString() + "]")    
  $(document).ready(function () {
      $('#demo').html('&lt;table cellpadding="0" cellspacing="0" border="0" class="display" id="example"&gt;&lt;/table&gt;');
  
      $('#example').dataTable({
          "data": dataSet,                
          "columns": [
                          { "title": "Center" },
                          { "title": "Call Executive" },
                          { "title": "Name" },
                          { "title": "Mobile" },
                          { "title": "Phone" },
                          { "title": "Status" },
                          { "title": "Appt Date" },
                          { "title": "Joined Date" },
                          { "title": "Remark" },
                          { "title": "Source" },
                          { "title": "Publisher" },
                          { "title": "css" },
                        ]
                        ,
          "fnRowCallback": function (nRow, aData, iDisplayIndex) {
              if (aData["css"] == "gradeC") {
                  $(nRow).addClass('gradeC');
              }
              else {
                  $(nRow).addClass('gradeN');
              }
          }
  
      });
  });      
  </code></pre>
  
  <p>Sample Datatable string (class is specified in last column) passed to function is:</p>
  
  <pre><code>    var dataSet = ['Dadar', 'lmsSenitaD', 'Atul salaskar', '9876543210', '', 'Not Joined', '10/01/2014', '', 'Come back and Join', 'Mobile', 'Times','gradeC'],
  ['Aundh', 'Rashmi', 'Preeti Gupta', '9876543210', '', 'Not Joined', '10/01/2014', '', 'Will Discuss with Family', 'Online Campaign', 'Iksula','gradeN'],
  ['Do@Home_Thane', 'Rashmi', 'Mitali Gupta', '9876543210', '', 'Joined - Old Date', '10/01/2014', '20/08/2014', 'Come back and Join', 'Online Campaign', 'Iksula','gradeC']; 
  </code></pre>