What is the best way to “reverse” a filter I’ve made, yet keep other filters on. For example, let’s say I have two filters on my dataset “Keyword Search” and “Status”. The data correctly filters if I click each individually AND it also correctly filters the data if I have both filters on.
However, if I have both filters on, then turn one off how can I get the data to add back in that data which originally was filtered out, yet still keep the first filter on?
Thanks Salman, this does work well. However, it requires I use the wix-datasets since the filter is a wix api. It’s a solid alternative, but ideally I can do this without using datasets.
@salman-hammed Thanks. This is working great except I have one dropdown that I want to connect to a few fields that are booleans.
Any thoughts or help on how to fit this code (or rather the result of ):
let filterPrice = $w("#priceRange").value;
if (filterPrice === "500") {
$w("#dataset1").setFilter(wixData.filter().eq("upTo500", true));
}
if (filterPrice === "1000") {
$w("#dataset1").setFilter(wixData.filter().eq("to1000", true));
}
if (filterPrice === "1001") {
$w("#dataset1").setFilter(wixData.filter().eq("over1000", true));
}
On to this line of your code (so my multiple filters work together) where color would be filterPrice:
if (color && color !== 'all') {
filter = filter.eq("color", color);
}
Any guidance would be GREATLY appreciated. I’ve been at this for weeks with no result. The struggle is that I don’t want to use a greater than or less than, but rather search a specific price range. I have the value in a number column as well, the boolean was a hack to try and accomplish searching a specific range.