TypeError: cellData.indexOf is not a function

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

As it says, it is not a function that you can use.

Have a look at here.
https://www.wix.com/corvid/reference/$w.TableCellEvent.html
https://www.wix.com/corvid/reference/$w.TableRowEvent.html

See previous posts for more.
https://www.wix.com/corvid/forum/community-discussion/open-local-page-on-table-row-select
https://www.wix.com/corvid/forum/community-discussion/linking-search-results-in-a-table-to-a-dynamic-page