I want to implement select all checkbox into JSF h:datatable
. This is the code if the h:datatable
:
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. .