Logical OR filter for one specific column
Logical OR filter for one specific column
Hi,
I was looking for a solution to implement a logical OR filter for one specific column. So if there is a column NAME then I would like to have a searchbox where I can enter different names and all rows that match one of the entered names will stay visible. I think this is an easy thing to do but blame me... I did´n find the easy solution yet :-(. Can somebody point me to the right information on how to achive this?
Maybe this is also possible to realize with the main search box. But this should also stay able to filter the other columns too (but one spec. with OR).
Thanks in advance
Worn
I was looking for a solution to implement a logical OR filter for one specific column. So if there is a column NAME then I would like to have a searchbox where I can enter different names and all rows that match one of the entered names will stay visible. I think this is an easy thing to do but blame me... I did´n find the easy solution yet :-(. Can somebody point me to the right information on how to achive this?
Maybe this is also possible to realize with the main search box. But this should also stay able to filter the other columns too (but one spec. with OR).
Thanks in advance
Worn
This discussion has been closed.
Replies
Allan
thanks for your quick reply! I have an additional question to that. Is there a way to enable this for the global searchBox? So to limit seach to one column and set it to regex search style so that I could search for names like name1|name2|name3? Otherwise I would have to replace the global searchbox with my own or add another searchbox? I know there is bFilter that could be set to false, then the searchbox disapperars but then something with DataTable.defaults.sDom has to be done? I haven´t found a hint how to use this DataTable.defaults.sDom to remain the filter feature but replace the searchbox.
Thank you!
Worn
This. You simply put an input element somewhere and bind fnFilter to it.
> I know there is bFilter that could be set to false, then the searchbox disapperars but then something with DataTable.defaults.sDom has to be done
If you want filtering to be possible, leave bFilter as it's default `true` value. Drop the `f` option from sDom to not display the default global filter.
Allan
thanks again. I guess I have enough information to start filtering now ;-). By the way thanks for that awesome plugin! Definetly one of the best jQuery-Plugins ever!
Worn
Allan