Database table onCellSelect() not working

I have a table that reads from a database. The table is shown in the attached screenshot. I wrote code to make it so that when a player name is clicked, it will open a lightbox for that player. Each lightbox name corresponds to the name column of the table. My code is shown below for the page with my table. The problem is, my page will never enter the onCellSelect() function. When previewing this code, it will print “iiii” to the console, but never “oooo”, even after clicking cells, which makes me believe that it never even enters the onCellSelect portion. I am unsure if it is something on my end, or if it is a technical difficulty. Any help would be appreciated! Thanks :slight_smile:

import wixWindow from ‘wix-window’ ;

$w( " #table1 " ).onCellSelect( (event) => {
console.log( “oooo” )
let rowIndex = event.cellRowIndex;
let rows = $w( " #table1 " ).rows; let name = rows[rowIndex].cellData;
wixWindow.openLightbox(name) } );

console.log( “iiii”)

Hello Cobi,

is this what you are looking for?
https://russian-dima.wixsite.com/meinewebsite/blank-1

Yes, for the most part. I made a support ticket and a wix team member was able to help me get the code. This worked for me:

import wixWindow from ‘wix-window’ ;
$w.onReady( function () {
$w( “#table1” ).onCellSelect((event) => {
let rowIndex = event.cellRowIndex;
let rows = $w( “#table1” ).rows;
let name = event.cellData; //Cell data
wixWindow.openLightbox(name)
});
});

I appreciate your help though!