【问题标题】:DataTables bootstrap pagination, checkboxes not getting added to all the rowsDataTables引导分页,复选框未添加到所有行
【发布时间】:2014-02-25 11:12:20
【问题描述】:

我在 DataTable 中使用引导分页,第一列包含复选框,默认显示记录数为 10,当我更改记录数时,仅显示 10 个复选框。

var oTable = $('.datatable').dataTable({
        aoColumnDefs  : [
{
    aTargets: [0],    // Column number which needs to be modified
    fnRender: function (o, v) {   // o, v contains the object and value for the column
        return '<input type="checkbox" class="cbox" value="hgh" style="opacity: 0;">';
    }
}],
        "sDom": "<'row-fluid'<'span6'l><'span6'f>r>t<'row-fluid'<'span12'i><'span12 center'p>>",
        "sPaginationType": "bootstrap",
        "oLanguage": {
        "sLengthMenu": "_MENU_ records per page"
        }
    } );

【问题讨论】:

    标签: javascript jquery twitter-bootstrap datatable pagination


    【解决方案1】:

    我认为问题在于“fnRender”函数在生成表时只调用了一次。为了解决这个问题,请在请求中处理更改行数并手动添加复选框。

    【讨论】:

      猜你喜欢
      • 2017-12-17
      • 2017-01-27
      • 1970-01-01
      • 2014-09-30
      • 1970-01-01
      • 1970-01-01
      • 2017-07-28
      • 2017-07-15
      • 2020-11-23
      相关资源
      最近更新 更多