How to implement Individual Column Searching using checkboxes?
How to implement Individual Column Searching using checkboxes?
This is my sample of datatables with checkboxes: http://live.datatables.net/kayedefu/1/edit
How do I implement Individual Column Searching using checkboxes? I am currently stuck and it seems I've done some of my solutions such as modifying the JS but it's not working.
For example: If a user checks the "Name" checkbox, the user can only search values in in the column "Name". While the "Name" is currently checked, if a user enters a value that is not included in the column "Name", it will show no data.
All suggestions and solutions will be appreciated.
Answers
Are you saying that when someone checks the Name checkbox and types into the default gloabl search input you want to only search the Name column? If so then you will either need to create your own input or take over the
keyup
event handler that Datatables creates, like this example:http://live.datatables.net/kiwoxuma/46/edit
Then in the event handler use
search()
if no checkboxes are selected orcolumns().search()
, specifying the appropriate columns, to search the checked columns.Kevin