简体   繁体   English

DataTables引导分页,未将复选框添加到所有行

[英]DataTables bootstrap pagination, checkboxes not getting added to all the rows

I am using bootstrap pagination in DataTable,first column contains checkboxes, default number of shown records is 10, when I change the the number of records only 10 checkboxes are displayed. 我在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"
        }
    } );

I think the problem is that "fnRender" function is called only one time when the table is generated. 我认为问题在于生成表时仅一次调用了“ fnRender”函数。 For solving this problem, handle changing row count in request and add checkboxes manually. 为解决此问题,请处理更改请求中的行数并手动添加复选框。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM