Datatables: Change cell color based on values

First of all, initialize DataTable only once. Then as per your question, use rowCallback and not fnRowCallBack as shown below: var oTable = $(‘#countryTable’).DataTable({ ‘rowCallback’: function(row, data, index){ if(data[3]> 11.7){ $(row).find(‘td:eq(3)’).css(‘color’, ‘red’); } if(data[2].toUpperCase() == ‘EE’){ $(row).find(‘td:eq(2)’).css(‘color’, ‘blue’); } } }); Here’s a fiddle

JQuery DataTables – Row Grouping, Sum, Collapsible, Export

“drawCallback”: function ( settings ) { var api = this.api(),data; var rows = api.rows( {page:’current’} ).nodes(); var last=null; // Remove the formatting to get integer data for summation var intVal = function ( i ) { return typeof i === ‘string’ ? i.replace(/[\$,]/g, ”)*1 : typeof i === ‘number’ ? i : 0; }; total=new … Read more

jQuery DataTables server-side processing using ASP.NET WebForms

I wrote a simple example that should illustrate the idea. Start by writing a generic handler for handling data on the server side (Data.ashx but this could be a web page, web service, anything server side script capable of returning JSON formated data): public class Data : IHttpHandler { public void ProcessRequest(HttpContext context) { // … Read more

Datatable styling so bootstrap button appears on same row as other elements

SOLUTION #1 This is the most confusing part with using Bootstrap style for jQuery DataTables and it’s undocumented so far. Bootstrap extension overrides default dom which can be confirmed by viewing its source code. You have to use specially crafted dom option similar to shown below: dom: “<‘row'<‘col-sm-3’l><‘col-sm-6 text-center’B><‘col-sm-3’f>>” + “<‘row'<‘col-sm-12’tr>>” + “<‘row'<‘col-sm-5’i><‘col-sm-7’p>>”, You can … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)