Add first column with two select boxes and the header should also have checkboxes
Add first column with two select boxes and the header should also have checkboxes
my testcase: http://live.datatables.net/gavelefa/3/edit
the checkbox should be the first column before Name. right now it is in the same cell as Name column.
The header for checkbox should also be a checkbox; if I select that it should make all checkboxes in all pages get checked.
https://datatables.net/extensions/select/examples/initialisation/checkbox.html i looked at this example but it doesnt have header with checkbox. and also, i am not sure why my checkbox is in Name's column. i tried making target as -1 it didnt work too.
thanks,
Uma-
This question has an accepted answers - jump to answer
Answers
You can use the Gyrocode checkboxes plugin which uses the select extension and provides a select all checkbox in the header.
Because column 0 is the first column which in this case is the Name column. You will need insert another column for the checkboxes, like this:
The
columnDefs.targets
docs explain this for negative numbers:Kevin