How to create effective “select all” checkbox in JSF

后端 未结 4 1357
别那么骄傲
别那么骄傲 2020-12-19 19:27

I want to implement select all checkbox into JSF h:datatable. This is the code if the h:datatable:



        
4条回答
  •  隐瞒了意图╮
    2020-12-19 20:10

    I have used this code to selectAll checkbox :

    $(window).load(function () {

        $(document).delegate(".checkall", "click", function(event) {
              $(this).closest("table").find(':checkbox').attr('checked', this.checked);
        });
    });
    

    it is working fine when I select/deselect checkbox in header then all the checkbox under that column are selected/deselected. But if again Iam selecting the same, then other checkboxes are not selected. .

提交回复
热议问题