JQuery DataTables - Number of Paging Numbers

2

I'm implementing DataTables pagination and I could not figure out how to change the number of paging number buttons.

As you can see, we have 1 a 5 , or we could have 7 a 11 numbers of the Page, that is, always 5 numbers . I would like to show 10 numbers , for example: 1 to 10 or 3 strong> or 7 to 17 or 11 to 21 , etc.

I hope I have been clear! Thank you.

    
asked by anonymous 10.06.2014 / 19:20

2 answers

3

You can change the number of pages that appear by changing the variable jQuery.fn.dataTableExt.oPagination.iFullNumbersShowPages, which by default is 5. Ex

jQuery.fn.dataTableExt.oPagination.iFullNumbersShowPages = 10;
$('#my-table').extend.dataTable({
    "bPaginate": true,
    "sPaginationType": "bootstrap",
    "bScrollCollapse": true
});

Link to explanation: link

    
11.06.2014 / 19:44
2

A simpler way would be to set the "iDisplayLength" property of the dataTable component. So:

$('#dtPagina').dataTable({                         
  "iDisplayLength": 100                         
});
    
03.06.2016 / 16:07