Datatables and checkbox behavior for filtering
Datatables and checkbox behavior for filtering
I am using datatables to filter values (using check boxes and drop-down menus). The "Name" filter column is a checkbox, while the Position and Office columns are drop-down menus. My system works fine, but I am experiencing the following issue.
When I select Name - Ashton it hides Garett and ID AI.
Expected Behavior: When I select Ashton, it should not hide Garett and ID AI. The user should be able to change their mind and select Garett or AD AI. But the user should be able to select only one checkbox at a time.(kindof like radio button). How can I achieve this. Thanks
Here is the link to the fiddle and code - https://jsfiddle.net/9a4wfszk/1/
Answers
Looks like you will want to remove column 0 from the
columns().every()
loop in the buildCheckboxes function. This is updating the checkboxes based on the remaining rows shown in the table. Just build the checkboxes once insideinitComplete
. I think I posted an example yesterday for you.Kevin
Thankyou. I decided to keep dropdowns instead of checkbox. Sprry for going back and forth. We are still trying to figure out the best approach.