Question:
Refresh Data after closing lightbox
Product:
Wix Editor
Hello everyone
I have a main page and a lightbox which is displayed on this same page. (by calling it with a button). On this lightbox, I modify my data (stored in tables).
Someone on this forum (Thank you Mark_Hunte) has helped me to refresh the repeater or tables (from which data have been modify on the lightbox) on my main page after closing the lightbox. ( it workfs perfectly for the dataset changes. ![]()
But my fields on the main page are not modified even if the data are refreshed and have good values in the collection. My dataset is being refreshed : that is ok.
Even if i asked to be refreshed: it doesnât retrieve last data upadted, but the penultimate update.
I would like that the data (already refreshed in the collection and the dataset and the table â Ok ) to be displayed in fields.
Here my code after closing the the lightbox:
wixWindowFrontend.openLightbox(âAjout SupplĂ©mentsâ)
.then(() => {wixData.query('Reservations') .eq("ReferenceReservation", $w('#NumResa').value) .find() .then(async (results) => { if (results.length > 0) { var Tarif = results.items.map(item => item.ARegler) var SUPP=results.items.map(item => item.totalSupplements) console.log ("Réservation trouvée : "+$w('#NumResa').value) console.log ("Total A REGLER à répercuter : "+ Tarif) console.log ("Total SUPPLEMENTS à répercuter : "+SUPP) //Rafraichir DATASET SUPPLEMENT $w('#SupplementsResa').setFilter(wixData.filter() .eq("ReferenceReservation", $w('#NumResa').value)) $w('#SupplementsResa').refresh() //Rafraichir DATASET RESA EN COURS $w('#ResaEnCours').setFilter(wixData.filter() .eq("ReferenceReservation", $w('#NumResa').value)) $w('#ResaEnCours').refresh() } else { console.log("Pas de réservation correspondant au N°"+$w('#RefResa').value) } }) })
Thank you for your help.

