Is there a way to "select all rows", or "check all checkboxes in each row" of a table?
My use case is:
I have a table, in which the user can select multiple rows via checking the check box
The checkbox column is a custom column of the table, with type = checkbox
The user now needs to select row by row
Is there a way to "select all" checkboxes, please? I am thinking along the lines of a JS query that sets the checkbox status to "True" for the checkbox column
Hey @oliver.ng — thanks for the great question! Yes you can write a JS query to select all rows in the table with the native table.selectRow() function that we expose. Here's an example:
table1.selectRow(_.range(0,table1.data.length))
You can even assign this as a custom button in the table footer. Here's a GIF:
@Tess thanks. this is very helpful. is there anyway at the moment to programatically access recordUpdates at the moment or it can only be done manually?
Potentially a useful feature request down the road.
Hi @alex , I'm trying to use this Select All method with a table that is mapped to a preceding Snowflake query. However, the Select All JavaScript doesn't appear to work when I do that.
I verified that the JavaScript works for a static table but it doesn't appear to work for a dynamic table.
Hi @ryguy022 It should still work for a dynamic table. In the cases where it isn't working, is tableName.data formatted as an array? If not, you may need to wrap the data input in formatDataAsArray():