Hi, I have linked a repeater to a dataset connecting database such that every item is shown in
a separate container.
I wish to add a button on every container that when clicked, manipulates the item showed at that
time in the container.
I have looked at $w('#dataset').getCurrent() and realized its not what I wonted, any idea for
how to do it classically?
thanks in advance
Go to the package section (under the backend files).
Install an NPM named: repeater-scope
and do something like:
import { useScope } from 'repeater-scope'; $w.onReady(() => { // use dynamic event handler with global selector function $w $w('#repeatedButton').onClick((event) => { const { $item, itemData, index, data } = useScope(event); $item('#repeatedText').text = itemData.title; }); });