Search code examples
yadcf

request yadcf AND vs OR option for multi_select


Searching for an answer I found ambiguous multi_select filter - AND and OR condition - javascript and looked in the code. I don't see any way to have the multi_select support AND (intersection) and OR (union, the default).

Consider the Tags column in http://yadcf-showcase.appspot.com/DOM_source_select2.html. I would like to see a checkbox, or better a toggle button (not sure the best text, maybe AND and OR as defaults, but even better if the text is configurable) to set behavior.

In this case, assume Tags is multi_select and set to Tag1, Tag2. AND function would show only first two rows. OR function (default) would show all rows except 7 and 10.

I'm not sure this could be achieved with multi_select_custom_func as I'm not sure how to implement the toggle button.


Solution

  • Right now you can use only one AND / OR but not both (with the help of multi_select_custom_func) , but you can open an enhancement request asking for adding checkbox (with configurable label) which will allow you to implement different logic when checked / unchecked inside your multi_select_custom_func implementation