@yisrael-wix I believe I figured out a part of the issue.
When updating itemData . _id like:
$w("#repeater1").forEachItem(($item, itemData, index) => {
console.log(index);
console.log(itemData._id); //check: before update
itemData._id = "item-"+index; //adjust _id
console.log(itemData._id); //check: updated correctly
} );
and subsequently executing:
$w("#repeater1").forEachItem(($item, itemData, index) => {
console.log(itemData._id); //check: old indices (preview) / new indices (published)
});
itemData does not seem to contain the updated ‘_id’ values (assuming that both functions run synchronously) in preview mode. Hence when I make adjustments in the first loop, these seem to get reflected, but later on, things go wrong because somehow the old ‘_id’ values are still in place.
In the published version, however, I’ve got the right ‘_id’ values in both loops, but then my changes are not reflected in the UI, only in the list of computed values.
Site URL:
https://thefashionsocietyh.editorx.io/website-11/page-3-mwe
Thoughts?