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

umaeswaraumaeswara Posts: 69Questions: 13Answers: 0

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

  • kthorngrenkthorngren Posts: 21,262Questions: 26Answers: 4,934
    edited July 2021 Answer ✓

    You can use the Gyrocode checkboxes plugin which uses the select extension and provides a select all checkbox in the header.

    i am not sure why my checkbox is in Name's column.

    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:

    i tried making target as -1 it didnt work too.

    The columnDefs.targets docs explain this for negative numbers:

    A negative integer - column index counting from the right

    Kevin

  • umaeswaraumaeswara Posts: 69Questions: 13Answers: 0
    • thanks kevin for the gyrocode example.
Sign In or Register to comment.