I have a table in a dynamic page connected to a dataset , the first column of the table retrieves images (uploaded to database from media > site files).
I’m trying to link the images in the table to Lightbox , i.e. when a cell populated with an image is clicked the image will popup.
My Code:
code inserted in Lightbox:
import wixWindow from 'wix-window';
$w.onReady(function () {
const recievedImage = wixWindow.lightbox1.getContext();
$w('#image1').src = recievedImage;
});
code inserted in dynamic page:
import wixWindow from 'wix-window';
export function table1_cellSelect(event, $w) {
let cellData = event.cellData;
//the cell contains an image
if (cellData.indexOf("image://") !== -1){
wixWindow.openLightbox("lightbox1", cellData);
}
}
table1 properties:
Select by cells
OnCellSelect - table1_cellSelect
Error:
TypeError: cellData.indexOf is not a function
Can anyone please help me and correct my code??
thanx,
Noa