How to save directly from repeater row

I have problem with saving data. I have 3 repeaters and 3 datasets filtered by “Urgent” “Later” and “Complete” notes. Onclick event should update-save status and refresh data. My code executes only first row from repeater it is not working with older notes.

export function iptStatusUrgent_click(event) {
setTimeout(saveUrgent(), 1000 );
}

function saveUrgent () {
$w( “#dbNotes” ).save()
.then(() => {
$w( “#dbNotes” ).refresh();
$w( “#dbNotesLater” ).refresh() ;
$w( “#dbNoteComplete” ).refresh();
})
. catch ( (err) => {
let errorMsg = err;
console.log(errorMsg);
});
}

In your iptStatusUrgent_click() event handler, you need to determine in which repeater item the button was clicked. You do that by using the Repeated Item Scope . You can then Retrieve Repeater Item Data When Clicked . The first sample code snippet under that section shows how to get the correct repeater item by properly accessing the appropriate dataset:

$w.onReady( function () {
  $w("#repeatedContainer").onClick( (event) => {
    let $item = $w.at(event.context);
    let clickedItemData = $item("#myDataset").getCurrentItem();
  } );
} );

Taking into account that the context has already been established, how is it done to save?

would it just save the dataset with my dataset.save ()?

Thank You for your help. I had hard time figuring out saving part, and finally got it.
I end up creating button witch sets field value I want, instead radio button.

$w( “#btnUrgent” ).onClick( (event) => {
let $item = $w.at(event.context);
let clickedItemData = $item( “#dbNotesLater” ).getCurrentItem();
$item( “#dbNotesLater” ).setFieldValue( ‘noteStatus’ , ‘Urgent’ );
$item( “#dbNotesLater” ).save()

.then(() => { 

      $w( "#dbNotesLater" ).refresh() ; 
      $w( "#dbNotes" ).refresh(); 
     
 }) 
 . **catch** ( (err) => { 

let errorMsg = err;
console.log(errorMsg);
});