When a user clicks on a repeater item, I know I can identify which repeater item has been clicked via
$w("#container").onClick( (event) => {
...
SelectedItemID = event.context.itemId;
..
});
If, in my repeater template, I have some text eg: $w(‘#text’) and an image Eg $w(‘#image’), is there a way to tell which of these widgets (within the repeater item) has been clicked as well as the itemID of the repeater item? But also…
Importantly, is there a way to do this and find both the itemid and which widget was clicked for use within a single .onClick callback?
The second part is important since I know I can create two .onClick functions - one for the repeater and one for the global-scoped widgets within the repeater. Each one of these will give me one piece of the information. The However, I want to take action using both those pieces of information when the repeater item is clicked. (I can’t use a global variable for example because this would create a race condition.). I know I could do it with a setTimout but that’s yuk. I’m looking for a more robust way.