I am trying to create a data-driven repeater. It works fine in the preview but is entirely invisible on the published site. I cross-checked the permissions of collections and they are visible to all. Don’t know what I am doing wrong here. Any help?
Make sure that you have synced your sandbox (preview) database with the Live database:
MY REPEATER NOT WORKING WHEN WORKING IT REPEATS THE DATA
ANYBODY PLEASE HELP
import wixData from ‘wix-data’;
$w.onReady( function () {
uniqueDropDown1();
});
function uniqueDropDown1 (){
wixData.query("location")
.limit(1000)
.find()
.then(results => {
const uniqueTitles = getUniqueTitles(results.items);
$w("#dropdown1").options = buildOptions(uniqueTitles);
});
function getUniqueTitles(items) {
const titlesOnly = items.map(item => item.states);
return [… new Set(titlesOnly)];
}
function buildOptions(uniqueList) {
return uniqueList.map(curr => {
return {label:curr, value:curr};
});
}
}
export function dropdown1_change (event, $w) {
uniqueDropDown2();
$w(“#dropdown2”).enable();
}
function uniqueDropDown2 (){
wixData.query("location")
.contains("states", $w("#dropdown1").value)
.limit(1000)
.find()
.then(results => {
const uniqueTitles = getUniqueTitles(results.items);
$w("#dropdown2").options = buildOptions(uniqueTitles);
});
function getUniqueTitles(items) {
const titlesOnly = items.map(item => item.districts);
return [… new Set(titlesOnly)];
}
function buildOptions(uniqueList) {
return uniqueList.map(curr => {
return {label:curr, value:curr};
});
}
}