Hi all,
I have repeater on my website which I manually set, after fetching my collection data
$w('#repeater1').data = []
$w('#repeater1').data = myData
$w('#repeater1').expand();
I set the data in the OnReady function:
$w("#repeater1").onItemReady(($item, itemData, index) => {
$item('#text1').text = itemData.myFirstField
$item('#text2').text = itemData.mySecondField;
})
My problem is that when navigating to this page with a direct link it will sometimes not show the collection data is set it to. It will never show the collection data when I use the browser back button.
If I set the data at a later moment than in the OnReady, for example with a ‘setTimeout’, it will show.
I have tried finding a method to track if the repeater has actually updated its view. But since the data is technically set, the following command logs the set amount of items, not the displayed amount.
console.log( $w('#repeater1').data.length )
Does anyone know the correct way of tracking the amount of displayed items? Or even better an actual fix why the repeater doesn’t steadily show it’s items?
Best,
Jochem