Follow these post, to understand more…
https://www.wix.com/velo/forum/community-discussion/wix-storage-checkboxgroup/p-1/dl-5fcc17364ce20b002d0ffbdf-5fcc15f3a032ca0034d80c97-1
And take a look onto this example here…
https://www.media-junkie.com/pflegeservice
…where you will find the shown working CODE above and a lot more usefull informations.
You will have first to filter and then send the filtered DATA to your repeater.
if ($w('#switch2').checked) {console.log("AND-Filter activated")
let query = wixData.query(DATABASE).limit(1000)
//Filter-DropDowns-------------------------------------------
for (let i=0; i < DropDowns.length; i++) {
if (MEMdropdowns[i]!==undefined && MEMdropdowns[i]!=="undefined"){
$w('#'+DDpräfix+(i+1)).value = MEMdropdowns[i]
query = query.eq(DropDowns[i], MEMdropdowns[i])
}
}
query.find()
.then(async res => {
itemDATA = await res.items
console.log(itemDATA)
})
}
Complete-Code…
import wixData from 'wix-data';
//------------[User-Interface-----------------------------------------------------|
var DATABASE = "your Collection-Name here"
var REPEATER = "ID of your repeater here"
var DropDowns= []
var MEMdropdowns = []
var DDprefix = "dropdown" ; //ID-prefix of all your dopdowns (DD1, DD2..)
//----------------------------------|
DropDowns[0] = "reference-column1" ; //column in your DATABASE ("title")
DropDowns[1] = "reference-column2" ; //column in your DATABASE
DropDowns[2] = "reference-column3" ; //column in your DATABASE
DropDowns[3] = "reference-column4" ; //column in your DATABASE
DropDowns[4] = "reference-column5" ; //column in your DATABASE
DropDowns[5] = "reference-column6" ; //column in your DATABASE
DropDowns[6] = "reference-column7" ; //column in your DATABASE
DropDowns[7] = "reference-column8" ; //column in your DATABASE
DropDowns[8] = "reference-column9" ; //column in your DATABASE
DropDowns[9] = "reference-column10" ; //column in your DATABASE
//------------[User-Interface-----------------------------------------------------|
//------------starting CODE-part when page loads.....
$w.onReady(function () {
load_uniqueTitles_DropDowns();
//$w("#Button").onClick(()=>{
// $w("#newbuilddataset").setFilter(wixData.filter()
// .eq("site", $w("#sitedropdown").value)
// .eq("location", $w("#locationdropdown").value)
// .eq("advisor", $w("#advisordropdown").value));
//});
$w('#sitedropdown').onChange(()=>{
MEMdropdowns[0] = $w('#sitedropdown').value
$w('#sitedropdown').enable();
FILTER_ENGINE()
})
$w('#locationdropdown').onChange(()=>{
MEMdropdowns[1] = $w('#locationdropdown').value
$w('#locationdropdown').enable();
FILTER_ENGINE()
})
$w('#advisordropdown').onChange(()=>{
MEMdropdowns[2] = $w('#advisordropdown').value
$w('#advisordropdown').enable();
FILTER_ENGINE()
})
});
//-----loading of DropDown-Unique-Titles for all given DropDowns.....
async function load_uniqueTitles_DropDowns() {
console.log("Load uniqueTitles for DropDowns")
let dbDATA = await wixData.query(DATABASE)
let Options = []
for (var a = 0; a < DropDowns.length; a++) {
if(DropDowns[a]!==undefined && DropDowns[a]!=="undefined" && DropDowns[a]!==null) {
await dbDATA.distinct(DropDowns[a])
.then((results) => {
let items = results.items
for (var b = 0; b <items.length; b++) {
Options.push([])
Options[a].push({"label": items[b], "value": items[b]})
}
$w('#'+DDprefix+(a+1)).options = Options[a]
$w('#'+DDprefix+(a+1)).placeholder = DropDowns[a]
})
}
}
}
function FILTER_ENGINE() {
if ($w('#switch2').checked) {console.log("Filter activated")
let query = wixData.query(DATABASE).limit(1000)
//Filter-DropDowns-------------------------------------------
for (let i=0; i < DropDowns.length; i++) {
if (MEMdropdowns[i]!==undefined && MEMdropdowns[i]!=="undefined"){
$w('#'+DDpräfix+(i+1)).value = MEMdropdowns[i]
query = query.eq(DropDowns[i], MEMdropdowns[i])
}
}
query.find()
.then(async res => {
let itemData = await res.items
console.log(itemData)
$w('#'+REPEATER).data = itemData
})
}
}