Pagination not working

Pagination not working

thenonthenon Posts: 3Questions: 1Answers: 0
edited September 2010 in General
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]

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    iTotalRecords and iTotalDisplayRecords should be equal unless you have a filter applied.

    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
  • thenonthenon Posts: 3Questions: 1Answers: 0
    Thanks Allan.
  • robbiesmith79robbiesmith79 Posts: 16Questions: 0Answers: 0
    How do you determine if a filter has been applied?
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    If you've typed anything into the filter input, or more specifically if the HTTP variable sFilter is an empty string or not.

    Allan
This discussion has been closed.