EloquentStudio / filter.js

Complete solution for client side filtering and rendering using JSON data
http://eloquentstudio.github.io/filter.js
MIT License
665 stars 183 forks source link

Filter multiple value from checkbox #137

Open Akia85 opened 7 years ago

Akia85 commented 7 years ago

I try to filter my view with multiple selection from a checkbox.

I have multiple options for "Features" ;

By exemple when I select Exclusive offer and Venetian Society, I want see only items with the at least this selection. (If an item has Exclusive offer + Ventian Society + Wellness, I want it on my view).

So, I tried with type "like" but it doesn"t work, when I select two options the view is empty.

JS: FJS.addCriteria({field: 'Features.name',type:'like' ,ele: '#feature_criteria input:checkbox', all: 'all', delimiter: ', '});

View;

<%= Features.map(function(f) { return f.name }).join(', ') %>

2016-09-07 13_07_27-testpage-filter html

Do you have any advice ?

jiren commented 7 years ago

you can use like this

FJS.addCriteria({field: 'Features.name', ele: '#feature_criteria input:checkbox'});
Akia85 commented 7 years ago

Thank you Jiren, but it's not working : 2016-09-07 13_07_27-testpage-filter html

Because I want Items with at least the two selected features in the Criteria.

visaals commented 6 years ago

Did you ever find a solution @Akia85?