Velo by Wix: Repeated item event handlers v2.0
It's my third post about event handling in repeated items. I show you a way that always has been in the documentation. I'm surprised why I hadn't noticed that before?
Yes, and again the event handling in Repeater. For me, the event handling of the repeated items was maybe the first confusion in my Velo projects.
I wrote two articles about it, you can find them in this blog:
- Event handling of Repeater Item - here we considered how to handle events in the repeated items and we created a primitive helper function.
- The utils for repeated item scope event handlers - here we created a more smart code snippet that can automatically receive parent Repeater item data from the event.
The main idea of these two articles, we shouldn't nest an event handler in any Repeater loop. It could be a reason when a callback function runs a few times by one event.
The Velo documentation is supposed to use the next way for handling events using event context.
In most cases, it's enough. But, if we need to receive an item data object or index of the fired item, the documentation provides something like this: