【问题标题】:Apply datatables empty table message across all columns跨所有列应用数据表空表消息
【发布时间】:2016-05-07 14:43:33
【问题描述】:

目前我设置了下表:

<table id="add_users_table" class="table table-striped table-hover table-bordered" cellspacing="0" width="100%">
    <thead>
        <tr>
            <th><input type="checkbox" id="add_users_checkbox_all" value=""></th>
            <th>ID</th>
            <th>Email</th>
            <th>Name</th>
        </tr>
    </thead>
    <tbody>
    </tbody>
</table>

$('#add_users_table').dataTable({
    "order": [],
    "columnDefs": [
        {"targets": [0,1], "width": "10%"},
        {"targets": [2,3], "width": "40%"},
        {"targets": 0, "orderable": false},
        {className: "text-center", "targets": [0, 1]}
     ],
     "language": {
        "zeroRecords": "<i>No new users are available to add</i>"
     },
     "ajax": "/datatable/group/add_users/" + group_id
});

这给了我正确的信息,但在第一列中被压扁了:

有什么方法可以应用此消息以适应所有列?

编辑:我的 ajax 结果是一个空数据行 {"data":[]},这会有所不同吗?

【问题讨论】:

  • 它正在工作jsfiddle.net/cmedina/7kfmyw6x/44你有额外的代码??
  • 奇怪,我的ajax结果是一个空数据行{"data":[]},这会有所不同吗?

标签: jquery datatables


【解决方案1】:

这是 DataTables 中的一个错误:DataTables Bug

尝试使用 nigtly 构建或更新版本的 DataTables。

【讨论】:

    猜你喜欢
    • 2019-12-24
    • 2012-08-04
    • 2015-11-06
    • 2011-01-27
    • 1970-01-01
    • 1970-01-01
    • 2012-12-31
    • 2015-08-21
    相关资源
    最近更新 更多