【问题标题】:How can I drop off some elements from DataTables?如何从 DataTables 中删除一些元素?
【发布时间】:2012-02-12 09:51:33
【问题描述】:

我刚刚成功地遵循了Twitter Bootstrap 2 DataTables 教程。

现在我有像 example 这样的数据表,但我想删除“每页记录”、“搜索”、“显示 57 个条目中的 1 到 10 个”和“分页”元素,只有表。

我该怎么做?

【问题讨论】:

    标签: javascript jquery twitter-bootstrap datatables


    【解决方案1】:

    在dataTables构造函数中指定额外的options,即:

    $('#example').dataTable( {
        "bFilter": false, // Disable searching
        "bPaginate": false, // Disable pagination
        "bInfo": false    // Disable info texts
    });
    

    【讨论】:

    • 我收到以下错误:“DataTables 警告(表 id = 'watch-list-table'):无法重新初始化 DataTable。要检索此表的 DataTables 对象,请不传递任何参数或查看文档用于 bRetrieve 和 bDestroy"
    猜你喜欢
    • 1970-01-01
    • 2018-08-15
    • 2021-12-09
    • 2013-06-14
    • 1970-01-01
    • 1970-01-01
    • 2017-04-24
    • 1970-01-01
    • 2012-06-19
    相关资源
    最近更新 更多