I’m trying to select a specific row from a table. I tried the $w ( “#myTable” ).selectRow(5) command but the row just doesn’t hightlight. What am I doing wrong?
$w . onReady ( function () {
$w ( “#myTable” ).selectRow(5);
} );
I’m trying to select a specific row from a table. I tried the $w ( “#myTable” ).selectRow(5) command but the row just doesn’t hightlight. What am I doing wrong?
$w . onReady ( function () {
$w ( “#myTable” ).selectRow(5);
} );
If the table is connected to a dataset, try:
$w.onReady(function() {
$w("#dataset1").onReady(() => {
$w("#myTable").selectRow(5);
})
});
Also make sure you have a least 6 rows in the table.
Hi and thanks for your quick reply. Why 6 rows? I can’t select a table row if it has less?
@internationalcovidsu
I meant if you run the exact code you posted.
The first row (not including header) is index 0.
So the 6th row has index 5.
If you don’t have at least 6 rows, you won’t be able to run $w ( “#myTable” ). selectRow ( 5 ); as this row doesn’t exist
@jonatandor35 Ah ok, that was just an example. Unfortunately, it’s not working. I just can’t select a row, no matter what the index.
@internationalcovidsu
I’ve never tried it, so I can’t tell. Maybe there’s a bug. But:
Make sure the dataset and table property IDs are correctly spelled.
Try to see if there’s any error log in the console.