Quantcast
Viewing all articles
Browse latest Browse all 82134

change css row with fnRowCallback

Hello. Allan has a good example to add a css to an element. I would like to be able to do the same to highlight or change the css of the row:
$(document).ready( function() {
  $('#example').dataTable( {
    "fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) {
      // Bold the grade for all 'A' grade browsers
      if ( aData[4] == "A" )
      {
        $('td:eq(4)', nRow).html( '<b>A</b>' );
      }
    }
  } );
} );

any idea about it? Somebody knows an example in the documentation? I am using it with the editor Display controllers example

I have tried this too:
   var table = $('#example').dataTable( {
		 "fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) {
			 if(aData[1]=="fjgj"){
        nRow.className = "hell";
      }

 
    return nRow;
    },

Viewing all articles
Browse latest Browse all 82134

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>