Hi,
I've got a page containing a repeater. When a user clicks the editButton in the repeater on said page, two things happen:
1) a lightbox is displayed to allow a user to edit the details displayed in the repeater
2) the lightbox is populated with the relevant information about the item that has been clicked in the repeater e.g. price, name etc
When I first open the page and click the edit button it works perfectly. The lightbox opens and it's populated with the correct info.
However, when I close the lightbox and go back to edit the details of another item in the repeater upon clicking the edit button the lightbox opens but it is populated with the details of the most recent item in the database not the clicked item.
Code is below:
$w.onReady(function () {
$w("#dataset3").onReady(() => {
// console.log($w("#dataset3").getCurrentItem()["_id"])
$w("#editButton").onClick((event) => {
let item = $w.at(event.context);
let id = item("#dataset3").getCurrentItem()["_id"];
console.log(id)
let carInfo = item('#dataset3').getCurrentItem();
console.log(carInfo._id)
wixWindow.openLightbox('Edit Your Car', carInfo)
.then((data) => {
});
})
});
Any advice would be greatly appreciated! Thank you
Wix Team - any advice would be brilliant :) Thank you in advance