Datatables 1.10 “Check all” via jquery

前端 未结 4 708
予麋鹿
予麋鹿 2021-01-02 09:36

I know this might seem primitive, but I\'ve been trying to implement it for a whole day, maybe because I can\'t fully comprehend how to use the API, I\'m using DataTables 1.

4条回答
  •  长情又很酷
    2021-01-02 09:43

    This should work for you

    var table = $('#numbers_table').DataTable();
    
        $('#checkall').click(function () {
            $(':checkbox', table.rows().nodes()).prop('checked', this.checked);
        });
    

提交回复
热议问题