Need a Column with Select List of check boxes
Need a Column with Select List of check boxes
Jo0
Posts: 2Questions: 1Answers: 0
Is it possible to implement a select list with checkboxes that will allow multiple value filtering on that column? I have column select list filtering working, I'm just trying to extend it to work with checkboxes and multiple values
This discussion has been closed.
Answers
Yes, I have a table displaying trace log events with different log levels. I setup checkboxes to filter which log levels are displayed. You will create a search plugin to build this. Here is a search plugin blog tutorial:
https://datatables.net/blog/2014-08-26
My code uses the legacy commands. I wrote it before I knew the difference You may want to use the current command versions. Since I wrote this early in my learning it may not be the best algorithm but it works.
I store the checkbox state in the DB for each user then when the page is opened I get the saved checkbox values and build the HTML setting the checkboxes appropriately. Then I use the below search plugin to filter column 2 based on the checked items.
Hope this helps you get started.
Kevin
I ended up just running with the Select Filtering example and changing it to add a collection of checkboxes. Then using JS and css to hide and display the list of checkboxes on select.