I have a repeater that is connected to a dataset with Read-Write mode . The repeater has some visible and some hidden fields all connected to the respective fields of the dataset. I would like to save the changes made by the user on any of the repeater rows. I tried the following code as per the discussion https://www.wix.com/corvid/forum/community-discussion/save-and-refresh-repeater.
it is not working .Only the first row of the repeater if changed by the user is saved. The other rows that are updated by the user are not saved.
I tried connecting a button to the dataset to submit the changes. It is not working either.
I am not able to get the $w(‘#Dataset’).save and $w(‘#dataset’).refresh to work
here is the code for saving the changes for the repeater items.
export async function SubmitButton_click(event) {
console.log("Updating");
let result = await $w('#OrderItemsDataset').save()
.catch( (err) => {
let errorMsg = err;
console.log(errorMsg);
});
result = await ResetPage();
return;
}
export async function ResetPage (){
let Result = await $w('#OrderItemsDataset').refresh()
.catch( (err) => {
let errorMsg = err;
console.log(errorMsg);
return false;
});
return true;
}
While working on this issue I noticed that if value of an input field is changed in code and not changed by the user the value is not updated in the table. not sure if this is related to the Save issue.
Other fields input by the user get updated. but only for the first row of repeater.
Please suggest a workaround.