jquery datatables - how to get the totalRecords to display during the pagination -
im using datatables plugin pagination. i'm trying server-side pagination working, start with, im facing issue of not been able display totalrecords entires in 'showing 1 15 of 15 entries' text. im using display records:
var resultstable = tableel.datatable( { "aadata": tabledata, "aocolumns": tablecolumns, "aasorting": [[1,'asc']], // "bserverside": true, "processing": true, "serverside": true, "sajaxdataprop": "api/1.0/accounts", "bprocessing": true, "pagingtype": "simple_numbers", "blengthchange": false, "bautowidth": false, "bscrollcollapse": true, "itotalrecords": 34, "itotaldisplayrecords":15, "idisplaylength": 15 } );
but still shows me 'showing 1 15 of 15 entries' instead of 'showing 1 15 of 34 entries'. idea im missing here?thanks, in advance!
my understanding itotalrecords
, itotaldisplayrecords
values returned server, not values set during initialisation.
can add code generates server-side data? how paging source data?
in accounts
method, should returning json object looks this:
return json(new { param.secho, itotalrecords = totalrecords, itotaldisplayrecords = totalfilteredrecords, aadata = result }, jsonrequestbehavior.allowget);
where itotalrecords
total, unfiltered record count , itotaldisplayrecords
filtered record count. result
contains 15 rows of data because @ point have performed paging query using datatable parameters idisplaystart
, idisplaylength
generate data. have information correctly display page when return json object datatable.
Comments
Post a Comment