selectRow() on new Table component

With the changed functionality in selectRow() on the new Table component (see Unable to dynamically select a table row using selectRow for the new syntax), it appears that using selectRow() to clear selected rows no longer works. Possibly this now requires a different syntax?

Hey PaulvG,

selectRow() works though at the moment it only supports selecting 1 row.

I'll refer to syntax examples that can be found in the original post.

// Selects row with primary key 4
table1.selectRow({ mode: 'key', key: 4 })

// Selects the row that represents table1.data[4]
table1.selectRow({mode: 'index', indexType: 'data', index: 4})

// Selects 5th row visible on the table
table1.selectRow({mode: 'index', indexType: 'display', index: 4})
2 Likes

Hi @stefancvrkotic, it does indeed work to select one row (already using that new syntax), but my issue is that it doesn't support deselecting rows anymore like it did with the legacy Table component using only selectRow(). :slight_smile:

Have you tried using table1.clearSelection()? That should be the new syntax for deselecting.

Ah! That did it, thanks! :slight_smile:
Where did you find that function? The component reference still covers the legacy table, not the new one, which made this a lot trickier than it needed to be.

After typing table1. started typing clear to see what functions are available that might apply.
image