How to count the json data before loading the datables
How to count the json data before loading the datables
Hi ,
How to count the records in datatables before loading . Below is my datatables
var Table;
function displayDataTable() {
Table= $('#example').DataTable(
{
"ajax": {
"url": '@Url.Action("Search", "Home")',
"dataSrc": "",
"dataType": "json",
},
"dom": '<"row"<"col-xs-6"f><"col-xs-6 text-right toolbar">>rt<"row"<i><l><"col-xs-12"p>>',
"pagingType": "simple_numbers",
"columns": [
{ "data": "CashId" },
{ "data": "PaymentType" },
{ "data": "Amount" },
{ "data": "PhoneNumber" },
{ "data": "Name" },
],
"columnDefs": [
{ orderable: false, targets: 5 }
],
"order": [[1, 'desc']],
});
}