Hello,
I'm having an issue.
I have a dynamic category page and I'm trying to pass infos into a lightbox.
Inside a the lightbox there's a table and a repeater(table for desktop and repeater for mobile).
Inside the dynamic page I have also a dropdown to go from page to page.
This dropdown has various values, some of them have more than 1 results, so what I did was to pass the info inside the lightbox if the results are more than 1.
So this works fine for the table but not for the repeater, this one doesn't show anything.
Here is the code I have for the dynamic page:
export function usAirlinesCat_change(event) {
let searchValue = $w("#usAirlinesCat").value;
wixData.query("UsaAirlines").limit(1000).contains("category", searchValue)
.find()
.then((results) => {
$w('#airportsTable').rows = results.items;
if (results.items.length > 1) {
wixWindow.openLightbox("DynamicAirlinesLightbox", $w('#airportsTable').rows = results.items, $w('#repeater1').data = results.items)
}
else {
$w("#dynamicDataset").setFilter(wixData.filter().eq("category", searchValue))
}
})
}
And this one is the code I have inside the lightbox:
this is the lightbox code:
import wixWindow from "wix-window";
var data;
$w.onReady(function () {
data = wixWindow.lightbox.getContext();
$w("#repeater1").data = data
$w("#airportsTable").rows = data
deskAndMob()
});
function deskAndMob () {
if (wixWindow.formFactor === "Desktop") {
$w("#airportsTable").show();
$w('#mobileRepeater').hide();
}
if (wixWindow.formFactor === "Mobile") {
$w('#mobileRepeater').show();
$w("#airportsTable").hide();
}
}
Have a read of the Wix Window lightroom api reference here, as it contains good examples of how to pass data between pages and lightboxes and vice versa.
https://www.wix.com/corvid/reference/wix-window.lightbox.html