So I have seen so many videos about filter on a repeater, but all I found are just dropdown filters. Can I make a double ended slider filter to filter the data? For examples, I can set the filter like $50-$600 or $80-$400 using a slider? Also, can I also make a multiple choices dropdown? Like I’ve got 100 of locations in the data, but I only want the repeater to show the result on 10 specific location that I chose. Is this possible?
It’s the same concept - on change, you retrieve the value from the slider/dropdown and filter the dataset (or query your collection) based on these values.
But what if I want to filter multiple field by using one dropdown.
Let’s say I’ve got three items showing on my repeater which are location1 location 2 and location 3
so here are 3 cases showing on my repeater:
A, B, C
B, A, D
C, D, E
if I set my filter to location A, then the repeater should be showing the following two cases:
A, B, C
B, A, D
So if I write the code in this way:
export function dropdown1_change(event) {
let searchlocation = $w(“#dropdown1”).value;
$w(“#dataset1”).setFilter(wixData.filter().contains(“location”, searchlocation));
}
then it will only be filtered the first column, so that the second case will not even be shown
how can I add “or location2 or location3”?
@hinhin0124 You should add more details because your example is not self-explanatory.
How it’s organized in your collection, how it looks on your repeater. You can add screenshots if you think it may help.
@jonatandor35 Let say I’ve got a form collecting people’s submission on their favourite place
and I wanted to show these submissions on a repeater like this:
so from the result 1 to 6, I wanted to add a dropdown filter, when user choose any options on the dropdown, I want the repeater to show the submissions that include what user chose on the dropdown filter, no matter it is in location1, 2 or 3.
For reference, when user chose Malaysia on the filter, then the repeater should show submission 1 and 3; when user chose LA, then the repeater should show submission 3 and 5; when user chose Germany, then the repeater should show submission 1, 3 and 5.
Thanks a lot for being so patient to me!!!
Now i got you. So you want to set a filter if location1 = value OR location2 = value OR location3 = value;
So you can read here about query with or() function:
https://www.wix.com/corvid/reference/wix-data.WixDataQuery.html#or
Also see Shan’s answer here:
https://www.wix.com/corvid/forum/community-discussion/a-simple-dataset-filtering
@jonatandor35 problem solved!!!
Thank you so much for helping me out!!!