"Show a button to clear selection " in Table settings doesn't appear to do anything

I thought this would be akin to a reset of the table, what does this thing do? It doesn’t show up in the docs or these forums.

Hi! When you have a row already selected in the table, the “Show a button to clear selection” option enables a “clear selection” button on the bottom of the table, which de-selects the selected row. LMK if that makes sense? Thanks!

if i a want to run the script on “Clear Selection” Button. How do i Achieve this?

Hello @hello (that tag gets me every time),

There isn't trigger that you can directly connect to the action, but when you clear the selection the tableName.selectedRow.index property does change. If "select first row" by default for the table is enabled, you would know the selection has been cleared whenever that property is "null":

After Clear:

What kind of script would you want to react to that change?

Hi

I enabled " Select Multiple Rows".
So After Selecting Multiple Rows, I am storing the data in below text component.

On clicking the clear selection
Table rows are getting cleared, But in the same time i want to clear the below text component as well.

So i want to run query on clicking the clear selection button.

@hello What is the text component below the table displaying? Could you show us the settings there?

I think "Clear selection" option in new tables has been removed from now on. And I can't find the option to enable it. Am I right? @alex-w
image
The image is from an old table present in an already built app. But for a new table, this option does not appear in settings.

It looks like it's still there to me, do you have "Multiple" selected in the Selection mode setting? image

I mean, when a row is selected, I would like to unselect all rows using the button I have shown in screenshot which says "Clear selection". @alex-w

I am using single selection.

The Clear Selection does not appear unless you select a row - fooled me to :slight_smile:

UIX would say maybe appear as greyed-out, but the existing Table UI already uses grey button and text to reduced visual noise

If you prefer, you could turn 'clear selection' off, and then use the Custom Button to say 'Clear Selection' and then run some JS to clear everything.

e.g

Records Selected: {{ tableBillingMergeView.selectedRow.data.length.toString()}} (click to clear)

image