Hey there,
Recently one of my repeaters refused to display any data I pass to it, even a blank item ({_id: ‘randomText’}), I can see the items by reading the repeater’s data, but nothing is displayed in the UI as if it has no items at all!
Here’s the code where the repeater is populated:
$w('#savedAddresses').data = [];
const addresses = [];
settings.address.list.forEach(address => {
let item = { _id: `address-${Math.floor(Math.random() *100000)}`, address: address, isDefault: false }
if (item.address.formatted === settings.address.main.formatted) { item.isDefault = true }
addresses.push(item);
});
addresses.sort((a, b) => {
if (a.isDefault) { return -1 } else { return 0 }
})
console.log("Addresses before assigning:", addresses); // Printing an array of 1 item
$w('#savedAddresses').data = addresses;
console.log("Addresses after assigning:", $w('#savedAddresses').data); // Printing an array of 1 item
And here’s the printed item:
{
"_id": "address-12473",
"address": {
"formatted": "address",
"location": {
"latitude": number,
"longitude": number
},
"city": "city"
},
"isDefault": false
}
Any idea? Help is appreciated!
Ahmad