Summery :
Hey I want help with this…
I’m getting a json from api using fetch
and then I’m using the json array in repeater, now when the page fully loaded wix call the api and assign the values!
The problem is :
Repeater items holders appear with the dummy data and after 2 seconds wix assign api data.
Code :
getProducts is a function in the back-end where i call the api with token, and this function return a json array.
getProducts().then(items => {
$w("#repeater1").onItemReady(($item, itemData, index) => {
$item("#image1").src = itemData.image;
$item("#text10").text = itemData.name;
$item("#text8").text = itemData.Description;
$item("#text6").text = itemData.price.toString();
$item("#button2").link = itemData.url;
} // end onItemReady
); // end getProducts function
// assign the json array to data repeater
$w("#repeater1").data = items;
});
The Question is there is a way to assign the values along as the page loading ?