I have an issue with Repeater.
I used repeater control. In repeater, I mapped the table "XYZ" columns including "_id" to the text input (ID: id) and I have "Delete" button in the repeater item itself. If I press the delete button, then the corresponding item should be removed from the table. So I have code to remove the entry from DB when the user click delete button.
But, the problem is the actual value of _id column which I mapped to repeater text is not coming in the code.
export function button1_click(event) { //Add your code for this event here: wixData.remove("offers", $w('#id').text).then((res)=>{ //This is not returning the id which I mapped from DB. Instead it is returning the text "Adult". $w('#msgBox').text="Deleted Successfully" $w('#msgBox').show() }).catch((e)=>{ $w('#msgBox').text="Failed to delete!! Please try later or contact us!!" $w('#msgBox').show() }) } Can somebody provide the solution for this? Thanks, Preethi
Hello Andreas,
Thanks, I tired the way mentioned in above link. It works fine now!!
You need to add a click handler to each item in the repeater. Look here how they do it in a sample. Hope it will help you.
https://www.wix.com/code/reference/$w.Repeater.html#onItemReady