Hello!
I have been trying to get some dropdown filters to work with a repeater linked to a database.
I have each filter working independently so that it will sort my repeater on change. The problem is that when one filter is changed the other one is basically negated. So if I want to sort by “affiliation” and “partner” at the same time it won’t do that. I want to be able to have users select one dropdown and then another and for them both to apply. I also have an “All” selection that will revert the drop down to show all options.
Any help on how I can essentially combine these filters to work together?
I am familiar with HTML/CSS and some other coding, but I am new to this coding!
Thank you in advanced!
Here is my code currently:
import wixData from 'wix-data';
$w.onReady(function () {
});
export function dropdown1_change(event){
let filterType = $w('#dropdown1').value;
if (filterType === "All"){
$w('#dataset1').setFilter(wixData.filter());
} else{
$w('#dataset1').setFilter(wixData.filter().contains("affiliation", filterType));
}
}
export function dropdown2_change(event){
let filterType = $w('#dropdown2').value;
if (filterType === "All"){
$w('#dataset1').setFilter(wixData.filter());
} else{
$w('#dataset1').setFilter(wixData.filter().contains("partner", filterType));
}
}
#dropdown #filters #repeaters #multifilter #multifunction #OnChange #help #coding