Hello again! I’ve been playing for a bit, and still slowly starting to understand this more and more. I keep going over other posts and more videos to try and refine my code with my limited knowledge. Hold back your laughter when you look at the code I’m about to post. Please let me know what I’m doing wrong! Again, I am trying to display results in a repeater based on whether items are checked off or not. I would like for the repeater to be hidden on load, and then all items related to the checked off box (or multiple boxes) to appear!
import wixData from ‘wix-data’;
function fillRepeater() {
wixData.query(“Artists”)
.eq(“cupcakes”, $w(“#checkbox1”).checked);
wixData.query(“Artists”)
.eq(“bridalCakes”, $w(“#checkbox2”).checked);
wixData.query(“Artists”)
.eq(“dessertBars”, $w(“#checkbox3”).checked);
wixData.query(“Artists”)
.eq(“sheetCakes”, $w(“#checkbox4”).checked);
.find()
.then((results) => {
//console.log(results.items);
let services = results.items;
//console.log(services.length);
$w(‘#repeater1’).data = services; // fills the repeater
});
})
.catch((err) => {
let errorMsg = err;
console.log(errorMsg);
});
}
$w.onReady(function() {
fillRepeater();
$w(‘#repeater1’).onItemReady(($w, itemData) => {
$w(‘#text51’).text = itemData.services;
$w(‘#text50’).text = itemData.travel ? ;
$w(‘#text49’).text = itemData.travelfee;
$w(‘#image1’).src = itemData.portfolio1;
});
});
export function checkbox_changed(event, $w) {
fillRepeater();
}