I have a checkbox in the thead of my table. If the datatable is redrawn (by filtering, searching, pagination, whatever) I want to make sure this is unchecked.
"fnDrawCallback": function() {
$(".checkboxes").uniform();
$(".table-checkbox input[type=checkbox]").attr('checked', false);
alert( 'DataTables has redrawn the table' );
}
The uniform call fixes a stylization problem within the datatable... the alert is just to to show after each redraw.
Does it matter that .table-checkbox is outside of the datatable and not dynamic (it is explicitly in the html of the thead)? I just want to make sure it is always unchecked upon table redraw.
EDIT :
The following works... is there a better way to do this? Apparently I need to call uniform on the thead as well to do this.
"fnDrawCallback": function() {
$(".table-checkbox input[type=checkbox]").attr('checked', false);
$(".checkboxes").uniform();
$(".group-checkable").uniform();
alert( 'DataTables has redrawn the table' );
}