Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inclusive/Excluse filtering mode #20

Closed
kazasoft opened this issue May 18, 2016 · 9 comments
Closed

Inclusive/Excluse filtering mode #20

kazasoft opened this issue May 18, 2016 · 9 comments

Comments

@kazasoft
Copy link

kazasoft commented May 18, 2016

hello
I have a few data-multifilter
sample

<ul>
   <li data-multifilter="1"> Green </li>
   <li data-multifilter="2"> Orange </li>
   <li data-multifilter="3"> Purple </li>
</ul>
<ul>
   <li data-multifilter="4"> text1 </li>
   <li data-multifilter="5"> text2</li>
   <li data-multifilter="6"> text3</li>
</ul>

And i have some blocks

<div class="filtr-container">
    <div class="filtr-item" data-category="1,2,4" data-author="John Doe" data-year="1998" data-novel="Cool book 1">
       <img src="img/sample.jpg" alt="sample">
    </div>
    <div class="filtr-item" data-category="1,3,5" data-author="Jane Doe" data-year="2003" data-novel="Cooler book">
       <img src="img/sample.jpg" alt="sample">
    </div>
    <div class="filtr-item" data-category="4,6" data-author="Jake Doe" data-year="2008" data-novel="Coolest book">
       <img src="img/sample.jpg" alt="sample">
    </div>
</div>

in defaul mode if i choice category 1 and 4 Filtterzr result 1 OR 4. But i need 1 AND 4. I need result only data-category="1,2,4"

is there any option to set the sampling algorithm? some INCLUSIVE/EXCLISIVE mode... like this http://wch.io/projects/tagsort/demo-stacks/

@giotiskl giotiskl changed the title several sample Inclusive/Excluse filtering mode May 18, 2016
@giotiskl
Copy link
Owner

giotiskl commented May 18, 2016

Hello @kazasoft, if I understand you correctly you want to render items that would belong to both of these categories.

Currently, there is no such functionality supported but this is a nice idea for a future patch, so I will keep it in mind 👍

The only functionality that does work in an exclusive fashion in Filterizr is the search function fltr.filterizr('search', searchTerm); but I doubt that would suit your needs.

@kazasoft
Copy link
Author

Yes, you understand correctly.
I look forward to the introduction of the functional.

@frizbog
Copy link

frizbog commented Jul 29, 2016

+1 for this feature request.
Great widget!

@wihodges
Copy link

+1

I tried doing some crazy stringing together of searchTerms but search bypasses the data-filter selections. Basically just becomes a search library...

@lbtuda
Copy link

lbtuda commented Jan 3, 2017

+1 any news?

@xileftenurb
Copy link

+1 I need this to!

@matif78
Copy link

matif78 commented Sep 28, 2017

Hi Guy,

Can you please help me how to implement AND operator in the search.. :(

I have about 100 products with different searching criteria.. right now i am facing the same problem

@xileftenurb
Copy link

xileftenurb commented Sep 29, 2017

if you check my pull request, it solve it (and add many other thing). check #61

I did not make much documentation, though. so it may be a bit hard to understand.

@giotiskl
Copy link
Owner

This feature is now added in 1.3.0.

You simple need to set the option when instantiating $('.filtr-container').filterizr({ multifilterLogicalOperator: 'and' });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
7 participants