jQuery.fn.dataTableExt.oPagination.iFullNumbersShowPages

jQuery.fn.dataTableExt.oPagination.iFullNumbersShowPages

ilatineilatine Posts: 20Questions: 2Answers: 0
edited April 2015 in DataTables 1.10

The below worked in version 1.9 but doesn't anymore when I upgraded the dataTable to v1.10.6

jQuery.fn.dataTableExt.oPagination.iFullNumbersShowPages = 3;
Here's a snippet of the code (datatable options):

    var myDataTable = $(tableID).dataTable({
        "sScrollY": "auto",
        "bDestroy": true,
        "bPaginate": true,
        "bProcessing": true,
        "aaData": tCells,
        "aoColumns": tHeader,
        "sPaginationType": "full_numbers",
        "iDisplayLength": (defaultDrillDownLength || 10),
        "aLengthMenu": [[10, 25, 50, 100, -1], [10, 25, 50, 100, "All"]],
        "sDom": 'RC<"topPagination"ilp>frt<"bottomPagination"p>',
        "aaSorting": (sortCols ? sortCols : [[0,'asc']]),  
        "oLanguage": {
            "sInfoFiltered": "",
            "sLengthMenu": "Show _MENU_ entries &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Data as of: " + dataAsOf
        },
        //turning bSortClasses off should be a performance boost for large datasets. disable the addition of the classes 'sorting_1', 'sorting_2' and 'sorting_3' to the columns which are currently being sorted on
        "bSortClasses": false,
        "responsive": false
    });
    
    jQuery.fn.dataTableExt.oPagination.iFullNumbersShowPages = 3;

Any ideas please?

Replies

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    edited April 2015

    It is called $.fn.dataTable.ext.pager.numbers_length in 1.10. It is still a hidden "feature" and isn't really fully supported - although it should work!

    Allan

  • ilatineilatine Posts: 20Questions: 2Answers: 0

    I get the following error when I do the below:
    $.fn.dataTable.ext.ext.pager.numbers_length=3;

    Error: SCRIPT5007: Unable to get property 'pager' of undefined or null reference

    Am I missing something?

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin

    Doh sorry - I had one too many ext.'s in the line... Edited now. Example: http://live.datatables.net/senigeye/1/edit

    It doesn't currently work with values less than 5 unfortunately due to the new ellipsis display.

    Allan

  • ilatineilatine Posts: 20Questions: 2Answers: 0

    Thanks a bunch. That worked!

This discussion has been closed.