I am using jQuery Datatable with server side processing, here is my code. It works fine nut as soon as i add one more column for actions button in it, it just stops rendering. Any help will be appreciated.
$("#table1").dataTable({
"processing": true,
"serverSide": true,
"info": true,
"lengthMenu": [[5, 35, 50, -1], [5, 35, 50, "All"]],
"ajax": {
"url": "/Customer/customers",
"type": "POST"
},
"columns": [
{ "data": "displayName", "orderable": true },
{ "data": "email", "orderable": true },
{ "data": "state", "orderable": true },
{
"data": "licenses", "orderable": true,
"render": function (data, type, row) {
if (type === 'display') {
if (data > 0)
return '<i class="fa fa-check" aria-hidden="true"></i>';
else
return '<i class="fa fa-times" aria-hidden="true"></i>';
}
return data;
}
},
]
});
Here is another column with action buttons i am adding after licenses in column array.
{
"data": null, "orderable": false, "render": function (data, type, row) { return '<a href="' + data + '">Download</a>'; }
},
Can anyone tell me what is going wrong here?