Skip to content Skip to sidebar Skip to footer

Jquery Datatables Pagination Setting

I'm trying to work with the pagination of the jquery datatables. I load the data with ajax. My response is now: aaData: [[:anonymous:, null, 2012-07-29 08:28:21, 0, 85 million, nul

Solution 1:

try this:

$("#myDataTable").dataTables({
     "bJQueryUI":true,
      "bSort":false,
      "bPaginate":true,
      "sPaginationType":"full_numbers",
       "iDisplayLength": 10
});

Solution 2:

$('#example').dataTable( {
  "pagingType": "full_numbers"
} );


DataTables has six built-in paging button arrangements:

numbers - Pagenumber buttons only (1.10.8)
simple - 'Previous' and 'Next' buttons only
simple_numbers - 'Previous' and 'Next' buttons, plus page numbers
full - 'First', 'Previous', 'Next' and 'Last' buttons
full_numbers - 'First', 'Previous', 'Next' and 'Last' buttons, plus page numbers
first_last_numbers - 'First' and 'Last' buttons, plus page numbers

Solution 3:

For anyone looking simply how to change number of pages displayed in pagination here is code snippet.

jQuery.fn.dataTableExt.pager.numbers_length = 10;

$(document).ready(function() {
  // Basic datatable
  $('#datatable').DataTable();
  .... rest of the code below....

You can change number of pages displayed in pagination changing the value '10' in first line.

Post a Comment for "Jquery Datatables Pagination Setting"