How to add select all check box feature in datatables
How to add select all check box feature in datatables
Sujan
Posts: 3Questions: 2Answers: 0
Hi Support,
I have developed a table structure using Datatable as per the http://l-lin.github.io/angular-datatables/#/basic/angular-way.
Kindly let me know the solution for
1. Adding check box in the column header and in all table rows.
2. Get specific column values, once we select the select all check box.
Best Regards,
Sujan
This discussion has been closed.
Answers
Haven't used Angular but the docs show installing the Select extension here:
http://l-lin.github.io/angular-datatables/#/extensions/select
This example shows using select with checkboxes:
https://datatables.net/extensions/select/examples/initialisation/checkbox.html
This example shows how to get the selected items:
https://datatables.net/extensions/select/examples/api/get.html
A select all checkbox in the header is not a builtin option in Datataables. There are numerous threads on this including:
https://datatables.net/forums/discussion/comment/137294/#Comment_137294
An easy way to incorporate a select all checkbox is to use Gyrocode's checkbox plugin. It utilizes the Select extension.
https://www.gyrocode.com/projects/jquery-datatables-checkboxes/
Kevin