【问题标题】:Datatables pagination hide 1 2 3 page button and have Next - Previoud Button ony数据表分页隐藏 1 2 3 页按钮并仅具有下一个 - 上一个按钮
【发布时间】:2018-03-24 00:21:51
【问题描述】:

我为我的 html 表使用了 datadables.net 分页。我想隐藏/删除分页中的 1 2 3 ... 按钮,并且只有下一个和上一个按钮。

是否有可能像做 pagingnumbers: false,(类似于代码中的这种简单更改)?

我的功能:-

$('#pagination').DataTable( {
            "pagingType": "full_numbers",
            "iDisplayLength": 2,
            "bFilter": false
        } );

【问题讨论】:

    标签: javascript jquery html pagination datatables


    【解决方案1】:

    您有 4 个选项:

    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
    So in your case :
    
     $('#pagination').DataTable( {
            "pagingType": "simple",
            "iDisplayLength": 2,
            "bFilter": false
        } );
    

    【讨论】:

    • 谢谢伙计。很有帮助:)
    【解决方案2】:

    你必须设置...

    "pagingType": "full",
    

    在这里您可以找到所有可能的组合...

    https://datatables.net/reference/option/pagingType

    希望对你有帮助

    【讨论】:

    • 谢谢你,伙计。 :) 有帮助 :)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-03-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多