Filter with text field and checkbox at the same time
Filter with text field and checkbox at the same time
[Deleted User]
Posts: 0Questions: 0Answers: 0
Hello,
i want to implement some kind of advanced filtering in one of my tables. Each row has a hidden col with a current status like "online", "offline", "disabled", ...
What i want do is:
1.) Filter the table based on the status with some checkboxes above the table. Each checkbox should show or hide rows with the checked status. For example i want to see all rows which are "online" AND "disabled" but i want to hide all rows which are "offline".
2.) At the same time i want to search for custom keywords in the text input field. But the search should only search in those records which are "visible" after doing the status search in 1.)
Is this possible? I search through the forum but didnt find a clear solution.
Thanks for helping.
i want to implement some kind of advanced filtering in one of my tables. Each row has a hidden col with a current status like "online", "offline", "disabled", ...
What i want do is:
1.) Filter the table based on the status with some checkboxes above the table. Each checkbox should show or hide rows with the checked status. For example i want to see all rows which are "online" AND "disabled" but i want to hide all rows which are "offline".
2.) At the same time i want to search for custom keywords in the text input field. But the search should only search in those records which are "visible" after doing the status search in 1.)
Is this possible? I search through the forum but didnt find a clear solution.
Thanks for helping.
This discussion has been closed.
Replies
The way to do this is to use fnFiler which will match on your hidden column, and have a regular expression which will do an OR (remember to switch of smart filtering for that column, or DataTables will use it's own regex). fnFilter documentation: http://datatables.net/api#fnFilter .
Allan