css和checkall复选框无法在datatable和bootstrap中工作

时间:2016-04-27 01:35:59

标签: jquery twitter-bootstrap datatable

使用bootstrap并将其与jquery DataTable集成。我的问题是,我勾选所有复选框。它不适用于第一页。但其他页面检查。并且css似乎也不起作用。那里的任何人都面临这个问题吗?见下图。

enter image description here

即时通讯使用此代码..

itk::PathSource

1 个答案:

答案 0 :(得分:0)

我们也使用项目的功能;你可能会这样做:

    // Handle click on "Select all" control
    $('#example-select-all').change(function () {
        // Check/uncheck all checkboxes in the table
        var checkbox=$('#example input[type="checkbox"]');
        var checked = $(this).is(":checked");
        checkbox.each(function(){
            if (checked) {
                $(this).attr("checked", true);
            } else {
                $(this).attr("checked", false);
            }
        })
    });
相关问题