Select All Table Component

Please add the ability to select all rows in a table with either
(1) a button at the top of the table [like the “clear selection”]
(2) a keyboard macro OPTION + Click to select everything between selection [like excel]

Hey! The keyboard idea is great - we are hoping to have a sprint at some point soon where we focus on adding keyboard shortcuts to Retool :slight_smile:
As for selecting all rows … you could bring in a separate button and then have a Run JS Code query that looks like this: table1.selectRow(_.range(0, table1.data.length)) … just make sure the table enables selecting multiple rows!

1 Like

awesome! Thanks.

How did that keyboard shortcut sprint go? It would be a great addition to have a list of them :grin:

Hey! We have not prioritized this yet but will let you know as soon as we get to it

1 Like

We actually have added Keyboard shortcuts in now! You can do the original goal here now in the top right ... menu of the app like this:

And how can we add the SHIFT shortcut to select a row until another row?

This almost worked for me. I needed to do this:

tblTemplateItems.selectRow(_.range(0, tblTemplateItems.displayedData.length))

This appears to select all of the rows or just the filtered rows if the table has been filtered.

Also the docs indicate that the selectRow() input value is an int. But apparently it can also be an array of ints.

Edit Notes:
I changed the code from this:

tblTemplateItems.selectRow(_.range(0, tblTemplateItems.data.sku.length))

Because this version selected all rows even if the table was filtered. The previous code worked just fine if the table is never filtered. Just note that the column property of the table.data object of the array, not the data object itself. This is different than selectedRow.data, displayedData and changeSet which are all arrays themselves.

Good note Bradly!

Tables can take in an input of either an array of objects or object of arrays ([ { key1: val, key2: val }, { key1: val, key2: val } ] or { key1: [val, val], key2: [val, val] }) which is a good distinction for anyone running in to syntax issues with an example!

Looks like we need to update the component reference page docs on the selectRow method! There's an additional list of JS methods on the scripting retool page that we should try and consolidate.