Closed virenbpanchal closed 5 years ago
Try setting columns.checkboxes.selectAll
option to false
to disable “select all” control in the header.
Thanks for your reply. Below solution works as you suggested.
//Below prevents click action on select-all checkbox in Header.
$('.dt-checkboxes-select-all').click(false);
Also I have make following changes to CSS to disappear Checkbox in header.
table.dataTable thead th.dt-checkboxes-select-all {
cursor: not-allowed;
}
table.dataTable thead th.dt-checkboxes-select-all input[type="checkbox"] {
display: none;
}
@virenbpanchal That's not the right solution (even though it kinda works).
Just use columns.checkboxes.selectAll
like this:
'columnDefs': [
{
'targets': 0,
'checkboxes': {
selectAll: false
}
}
]
This simply disables the checkbox in the header and doesn't require any CSS or other code to make it work or look good.
Hello,
How to remove checkbox from header of a datatable. I have tried below changes in CSS. Though cursor is not allowed, it still clickable and selects all records.
Thank you very much for all your time and effort you have put for this awesome jquery-datatables-checkboxes. It really helps.