I'm trying to bind to the server side of Angularjs Datatable in this link https://l-lin.imtqy.com/angular-datatables/#/serverSideProcessing
Therefore i use this code
$scope.dtOptions = DTOptionsBuilder.newOptions() .withOption('ajax', { dataSrc: function(json) { conole.log(json) json['recordsTotal'] =json.length json['recordsFiltered'] = json.length json['draw']=1 conole.log(json) return json; }, url: 'api/footestrecords', type: 'GET' }) .withOption('processing', true) .withOption('serverSide', true) .withPaginationType('full_numbers');
I added recordsTotal, recordsFiltered and a row manually in the dataSrc parameter
and this is json data before and after adding recordsTotal, recordsFiltered and row
json data before adding
[Object, Object, Object, Object, Object, Object, Object, Object, Object,Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object]
json data after adding
[Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object,Object, Object, recordsTotal: 28, recordsFiltered: 28, draw: 1]
the problem with pagination does not work, the data table shows all the data on one page, and when I click the paging button, there was no action.