$w("#repeater").forEachItem not working on all items

Here’s the code that i’m using I have a dataset with 50 items total and 25 displaying with pagination.

$w("#dataset1").onReady(() => {
$w("#repeater1").forEachItem(($item, itemData, index) => {
if (itemData.pro) {$item('#box1').show(); }
console.log(itemData.pro) //logs fine
});
});

It will only work for the first 25, I can’t update it on pagination change

Hi Carlos,

Try these three things, and it should display as you had hoped.

  1. Use a page onReady too
  2. Check “Hidden on load” for box1
  3. Use onItemReady instead of forEachItem
$w.onReady(function () {
$w("#dataset1").onReady(() => {
$w("#repeater1").onItemReady(($item, itemData, index)={
    if (itemData.pro) {
        $item('#box1').show();
        console.log(itemData.pro) //logs fine
    }
});
});
});

Had the same issue. Fixed by changing forEachItem to onItemReady. Thank you @tony-brunsman