Quantcast
Channel: Free community support — DataTables forums
Viewing all articles
Browse latest Browse all 35272

ColumnDefs did not get called

$
0
0

I have the following code

    $("#datatable").dataTable({

    "ajax": {
      "url": "http://some data source/",
      "dataSrc" : "",
      "columnDefs": [ {

        "render": function ( data, type, col ) {
           return data +' ('+ col[3]+')';
        },
        "targets": 0
      } ]
    }
  });

My Ajax data is just an array without the "data" attribute. I can see the data retrieved and displayed on the data table. However, the columnDefs was never called. Please help.

Also, there is data returned which I don't want to display. I assume I will need to create another columnDefs for that column and set visible to false?


Viewing all articles
Browse latest Browse all 35272

Trending Articles