How to show checkboxes to select rows and to how to show columns for edit or delete records?
How to show checkboxes to select rows and to how to show columns for edit or delete records?
jstuardo
Posts: 104Questions: 41Answers: 0
Hello,
I have browsed examples and I could not find a way to show checkboxes to select rows.... besides that, I need to add 2 more columns to the right of the grid. One to show an icon to allow record edition and other to show an icon to allow record deletion.
Is all this possible in DataGrid?
Regards
Jaime
This discussion has been closed.
Answers
If you use the Select Extension then tis example will show you how.
https://datatables.net/extensions/select/examples/initialisation/checkbox.html
columns.render
is probably what you want for the buttons.Kevin
Hello... and is it possible to add a checkbox to header in order to select all records? This is not actually a checkbox, so I am not sure how to add it to header.
Thanks
Jaime
See if this thread helps:
https://datatables.net/forums/discussion/comment/132137/#Comment_132137
Didn't you ask this same question here:
https://datatables.net/forums/discussion/52083/how-to-use-select-plugin-with-ajax#latest
Please don't duplicate questions.
Kevin
It did not help..... it was a real pane to add that plugin... I have added and it worked at first, but with the ugly checkbox.... I tried by using bootstrap4 style checkbox but I got several problems... maybe that CSS entered in conflict with some styles in my site.
After several hours attempting this (about 3 hours), I have decided to continue using the "select" plugin coming with DataTable. So, using this plugin, how can I show a checkbox to the header?
Did you look at the example in the last post by Colin? It puts a checkbox in the header.
Kevin
Yes, of course.... but he only placed an INPUT with type checkbox, which looks ugly compared to checkbox for each row.
As I wrote in my question, the checkbox for each row is not actually a checkbox, but only CSS styles ruled by ::after and ::before selectors.
I am not sure how to add those selectors for the header cell.
Regards
Jaime
Found this thread. Maybe bindrid's example will help.
https://datatables.net/forums/discussion/comment/134787/#Comment_134787
Kevin