Pagination not working
Pagination not working
Hi.
My init code looks like below, but for some reason the pagination controls aren't working... i.e. the next page button is disabled.
Everything else works fine.
iTotalRecords and
iTotalDisplayRecords
are being set correctly by the server ( UI says "Showing 1 to 25 of 25 entries (filtered from 9394 total entries)") for example.
Any tips on what might be missing?
v 1.6.2
Many thanks.
[code]
_table = $('#tblMessages').dataTable({
"bProcessing": true,
"bServerSide": true,
"sPaginationType": 'full_numbers',
"aoColumns":
[
/* Id */{"bSearchable": false,
"bVisible": false
},
/* Message */null,
/* Created At */null,
/* Sent At */null,
/* Acknowledged At */null,
/* Procesed At */null,
/* Is Incoming */null,
/* Parameter */null
],
"sAjaxSource": "/Device/_GetDeviceMessages2/foo",
"fnServerData": function(sSource, aoData, fnCallback) {
/* Add some extra data to the sender */
aoData.push({ "name": "StartDateTime", "value": $('#StartDateTime').val() });
aoData.push({ "name": "EndDateTime", "value": $('#EndDateTime').val() });
$.getJSON(sSource, aoData, function(json) {
/* Do whatever additional processing you want on the callback, then tell DataTables */
fnCallback(json)
});
}
[/code]
My init code looks like below, but for some reason the pagination controls aren't working... i.e. the next page button is disabled.
Everything else works fine.
iTotalRecords and
iTotalDisplayRecords
are being set correctly by the server ( UI says "Showing 1 to 25 of 25 entries (filtered from 9394 total entries)") for example.
Any tips on what might be missing?
v 1.6.2
Many thanks.
[code]
_table = $('#tblMessages').dataTable({
"bProcessing": true,
"bServerSide": true,
"sPaginationType": 'full_numbers',
"aoColumns":
[
/* Id */{"bSearchable": false,
"bVisible": false
},
/* Message */null,
/* Created At */null,
/* Sent At */null,
/* Acknowledged At */null,
/* Procesed At */null,
/* Is Incoming */null,
/* Parameter */null
],
"sAjaxSource": "/Device/_GetDeviceMessages2/foo",
"fnServerData": function(sSource, aoData, fnCallback) {
/* Add some extra data to the sender */
aoData.push({ "name": "StartDateTime", "value": $('#StartDateTime').val() });
aoData.push({ "name": "EndDateTime", "value": $('#EndDateTime').val() });
$.getJSON(sSource, aoData, function(json) {
/* Do whatever additional processing you want on the callback, then tell DataTables */
fnCallback(json)
});
}
[/code]
This discussion has been closed.
Replies
iTotalRecords - Total records, before filtering (i.e. the total number of records in the database)
iTotalDisplayRecords - Total records, after filtering (i.e. the total number of records after filtering has been applied - not just the number of records being returned in this result set)
http://datatables.net/usage/server-side
Allan
Allan