I am new to wix. I have been looking for the solution and attempted to fix it myself for a few days but I could not still fix it. Thus, I would like to look for help from here. Thanks in advance.
Here is the background -
In one of my member page, I have set up a repeater that is connected to a dataset. It is designed to display a list of records (as a repeater) from the dataset on the filter of the member’s email address. One of the functions in this page is to allow the member to update the specific record in the repeater when he clicks a button on that specific record.
Here is the issue -
when I click whichever button in the repeater, the event handler of that button always shows the same data from the dataset (while I can find the correct itemId from the event context). What I want to do in that handler is that when the button is clicked, I use the itemId captured from the event context and update that record in the dataset to set that record’s status (which is a text field) to “Approved”. How can I do that?
Here is the code I am stuck at -
export function button2_click(event) {
// Add your code for this event here:
let id = event.context.itemId; //this ItemId is correct
let count = $w( “#dataset1” ).getTotalCount();
let item = $w( “#dataset1” ).getCurrentItem();
console.log(item); //this always displays the same item regardless of which button I click. I tried to loop through the dataset with getItems() and next(). Still I could not find the right way to do it.
//Set the status to “Approved” of that item
}