I have tried triggering the onItemReady event for a repeater in 2 ways but I am getting consistently strange results.
I need to perform some math in certain situations inside the repeater so what I have is this
dbField → connected to a dataSet and hidden from users
displayField → can be updated if a user changes something on the repeater item (This works fine, there is an input field and if they change it the field value takes the dbField * input and puts it into the displayField
However I also want to populate the displayField with the dbField as a default value, and the only value in some situations, as inputs are not allowed always.
$w . onReady ( function () {
$w ( “#allMeals” ). onItemReady ( ( $item , itemData , index ) => {
console . log ( “checkingitem” )
})
})
is one way I tried it and the other is
export function allMeals_itemReady ( $item , itemData , index ) {
console . log ( “checking Item” )
}
I have used this before with no issues. But this time it is only running for some items in the repeater. I am showing 18, and it only runs for the last 6 items.
Now I would prefer doing it this way as these are initial values, I also wanted to keep my db linked field separate from my display field just for organization purposes. I know I could try to figure out a time to do a forEach on the repeater but I would prefer not doing that as timing could be tricky on it I would imagine. This is also the initial load of the repeater, I saw some posts about it only running on new items being created and not ones already loaded. This is fine for me as there should be no items loaded yet. I would want it to run on all items.
Is there some limit to how many items this runs on? If I set it to only show 9, it runs on all, if I set to 18 it only runs on 6. I am worried if this is performance based it might be inconsistent for users.