Column multiple select filter
Column multiple select filter
Muhammad Izzat
Posts: 22Questions: 10Answers: 0
Hello everyone and Mr.Allan, base from this filter datatables.net/examples/api/multi_filter_select.html how can I upgrade the filter into a multiple select checkbox, for example in the example table I want to filter select NewYork, San Francisco
and London.
Any help is much appreciated, thanks.
This discussion has been closed.
Answers
There may be an easier way, but I use the
regex
parameter in thesearch
function. Here is an example from some of my code:Note: I don't use the same syntax to create my select dropdown - I create it elsewhere and then just use the id to attach the change function. The important part is assembling the regular expression from the selected options and then using that to search on the column that you want.
Hey jaz, thanks for your reply apologies for he late reply, currently I'm having issue appending the data in my column into my select field so I had to postpone this part till fix that, will get back to this immediately afterward, thank ou so much
Hi,
i have multi select in that I am select cat and dog I convert into the format which you mention on earlier comment like (cat|dog) it is not working properly when my data is:
cat india | xxx | xxx
cat uk | xxx | xxx
cat | xxx | xxx --------------> I want this row alone
dog | xxx | xxx
god PK | xxx | xxx
See if this recent thread, discussing multiple selects when searching columns, helps:
https://datatables.net/forums/discussion/51547
Kevin