Question:
setting $w('#MyRepeater').data = await GetData(someArgs)
does not work.
after the assignment i’m printing the repeater data and it has 3 elements with ids only which are item1, item-j9ples3e, item-j9plerjk
Product:
Wix Studio
What are you trying to achieve:
Trying to set the repeater data dynamically with Velo
Additional information:
The repeater is not connected to any dataset dynamically
setting the data to a static variable does seem to work
setting the data with the await call does not trigger onItemReady
Hi, Omer_Kawaz !!
Please try placing onItemReady
before $w('#MyRepeater').data = await GetData(someArgs)
. If you’re already doing that, try clearing the repeater first with $w('#MyRepeater').data = [];
before inserting the data into the repeater.
Hey onemoretime, thanks for the comment!
unfortunately, i have already placed the onItemReady
call before the data setting, and tried to reset the data right before calling $w('#MyRepeater').data = await GetData(someArgs)
and now i see the data is []
, again did not change when using the dynamic data
The format of the data you’re trying to insert into the repeater might be incorrect. Are there any errors showing in the browser’s console?
that’s the structure of the data:
[
{
“_id”: “someUniqueString1”,
“order”: 1,
“chapters”: []
},
{
“_id”: “someUniqueString2”,
“order”: 2,
“chapters”: []
},
…
]
no errors shown, tried putting the code inside a try-catch block, and no errors were thrown as well
“I see. That’s a bit strange. I haven’t experienced a repeater being that unresponsive, so I may not be able to offer an immediate solution here. However, if you search for keywords like ‘onItemReady’ in this community, you’ll find many responses related to ‘onItemReady not working,’ and there might be an answer to your issue among them. Also, if there’s no problem, I recommend posting the part of the code where you’re dynamically loading the data here. That way, other community members will be more likely to help solve your issue, so please go ahead and do that.”