How to implement Individual Column Searching using checkboxes?

How to implement Individual Column Searching using checkboxes?

JoshNavJoshNav Posts: 2Questions: 2Answers: 0

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

  • kthorngrenkthorngren Posts: 21,343Questions: 26Answers: 4,954

    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 or columns().search(), specifying the appropriate columns, to search the checked columns.

    Kevin

Sign In or Register to comment.