Code to Connect Repeater Button to Individual Item

I would like to get a collection items from a repeater category page button using Code.
I can link my “more info” button using Wix built in feature successfully. I will prefer to use code.
However, when I use the below code for the “more info” button, it calls up the same item from the collection regardless of the different container. Can anyone help?

My code is:
import wixLocation from ‘wix-location’ ;

export function button1_click(event) {
let targetId = $w( “#dynamicDataset” ).getCurrentItem()[ ‘link-items-title’ ];
wixLocation.to(targetId);

Thank you.

Try this →

export function button1_click(event) { 
  let $item = $w.at(event.context);
  let targetId = $item("#dynamicDataset").getCurrentItem()['link-items-title'];
  wixLocation.to(targetId); 
}

Usually, you will use at() in a event handler that handles events fired on an element contained in a repeater to get a selector with repeated item scope.

Solved! @ajithkrr
Ajit Kumar thank you so much for the help. It works. I also appreciate the tip.

:grinning: Best of Luck !!!