Weird problem with onRowSelect

Hello everyone,

I am using the below code to go to a dynamic page from clicking a row in the table. It’s working perfectly, just not on the first row in the table…

Not sure if I’m missing something obvious or not.

The consol.log doesn’t even run when clicking the first row so its not registering onRowSelect for that row.

export function table3_rowSelect(event, $w) {
$w(‘#table3’).onRowSelect( (event) => {
let rowData = event.rowData;
console.log(rowData);
wixLocation.to(“/SSNZSS18/”+rowData.name);
});

Plus one more } I didnt copy…

Hi,
There’s an unnecessary duplication in your code.
The code block is already inside

export function table3_rowSelect(event, $w)

which is called when a row is selected, so there’s no need to add another registration for onRowSelect.

I suggest to simply remove the following (and the closing braces, of course):

$w('#table3').onRowSelect( (event) => {

I’ll give that a try thanks!