Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82099

Data table page length and start params does not synchronize with json endpoint.

$
0
0

I want to synch my json params with data table params. please help me how can i fix it.

here is my code.
var table = $('#example').DataTable( {
serverSide: true,
processing: true,
pagingType: "full_numbers",
paging: true,
lengthMenu: [10, 25, 50, 75, 100],
ajax: {
url: 'http://localhost:8080/file/myjson.do',
dataFilter: function(data){
var json = jQuery.parseJSON( data );
//this is working fine
json.data = json.dataList;
json.recordsFiltered = json.AlldataList;
//
//the last 2 not working.
json.length = json.pageSize;
json.start =json.startIndex;
return JSON.stringify( json ); // return JSON strin
}
});

json response
dataList […]
AlldataList 3471
startIndex 0
pageSize 10


Viewing all articles
Browse latest Browse all 82099

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>