I have a multi-selection group of checkboxes. I can print out the boxes that are checked
var listCateg = $w("#categoriebox").value
Printing listCateg gives me for instance: [“Economy”, “Philosophy”]
I’m trying to filter out my collection if any of the strings in the list above are found in a field of my collection (called themes).
I can filter out fine using 1 value:
$w("#dataset1").setFilter(wixData.filter()
.contains("themes", listCateg[0]));
This gives me all the books that are about economy.
I can also filter out fine using 2 values:
$w("#dataset1").setFilter(wixData.filter()
.contains("themes", listCateg[0])
.or(wixData.filter().contains("themes", listCateg[1])
)
)
This gives me all the books that are about economy or those that are about philosophy.
However, I can’t seem to be able to filter using all strings in my list, i.e. something like:
$w("#dataset1").setFilter(wixData.filter().hasSome("themes", listCateg));
Can anyone tell me how to filter a repeater’s output using all values found in a list?
Thanks a lot