How to select all rows of a table

Hey,

I have a process where a user clicks 'next' to move from one view on a tabbed container to the next.
On the second view I have a table which I would like to have all the rows selected automatically after clicking the 'next' button on the first view.

I've been trying to play around with an event to trigger a JS query that uses the following logic:
table1.selectRow(_.range(0,table1.data.length))

But this doesn't work for me.
Any help will be much appreciated.

I tried the following in a transformer but did not see the rows selected
return {{ dataTable.selectedRow = _.range(0,dataTable.data.length) }}
and in a js query

dataTable.selectedRow = _.range(0,dataTable.data.length)
return dataTable.selectedRow

same result...

Thank you @ScottR. So you basically saying there is no way to do this? Or you didn't come up with one?

Hello, you need to set the row selection to Multiple and run the following script


image

{{ Array.from({length: table1.data.length}, (_, index) => index) }}
1 Like

Thanks you @Skizhu it seems to work!

1 Like