My datatable contains several pages of data, and I have a column of checkboxes, with a checkbox being in the header as well.
I basically want to check all of the checkboxes on the same page of the datatable when the header checkbox is selected. While it's working, it's also jumping me to different pages of the datatable.
For example, if I'm on page 4 of the table and I click the checkbox in the header row, it selects all of the checkboxes just fine, but then it jumps to page 1 on the table (with the checkbox still selected)
Can someone tell me what I'm doing wrong? Here's the .js that's being loaded with the page containing the table:
$('#issues').dataTable();
$("#checkAllIssues").click(function(){
$('input:checkbox').not(this).prop('checked', this.checked);
});
* EDIT *
I think I just found the issue. Any time I sort a column, it changes back to page 1 of the table. I think the checkbox cell should be made non-sortable for this to stop doing this.
SOLUTION
I simply had sortable rows still enabled, and that affected me. I had to disable sorting on the checkbox column so that checking the checkbox in the header row did not cause the table to be sorted and redirected back to page 1.