I have 100+ Course listings in a 10-item repeater connected to a dataset and I want to check each item and, if that item’s cStatus field indicates it is a bookable course, change the button label of that item to read: “bookable”.
$w("#dataset1").onReady(()=> {
$w("#repeater1").forEachItem( ($item, itemData, index) => {
if(itemData.cStatus === "BOOK"){
$item("#button104").label = "Bookable"
}
});
});
This code almost works. It scans (and if bookable) changes the button label of the 10 items that appear in the repeater on page load. But it does nothing for the repeater items that appear after the “show more” button is pressed or a data filter is applied.
I need code that either a) reads thru and updates the entire dataset on page load, or updates the repeater as its contents change. Thought of adding an onChange() event handler to repeater1 or its filter buttons, but don’t see that option for repeaters.