I think there might be an issue with the Hidden field in table actions. The screenshot below should highlight the issue.
Goal: Trying to hide a table row action based on a field value in the current row
Steps:
Add table component and pass an array of objects to it
Create table row actions
Try to dynamically set the Hidden field of an action using a value of one of the columns in the table
Details: The Disabled field seems to work as expected. When I pasted the same value in the Hidden field, it does not work. I've tried setting the value to any other table property that references the current row, but none of these properties seem to be accessible from this Hidden field.
Hey @cosmick thanks for all of these details! This is currently by design, although we've gotten quite a few requests to enable hiding by currentSourceRow, so we might end up supporting this in the future.
The thinking with not supporting currentSourceRow in the hidden field was that it could be confusing to end users if buttons aren't visible on some rows and are visible on others and they can't see the logic. The workaround is to use disabling, which would give more context to end users
Thanks for the reply, @Tess. I can understand that it might be confusing for the end user to have actions available on some rows and not others. I noticed tooltiips don't appear on disabled actions, on-hover, and perhaps it might be useful to support this, so at least we can display a message to the end user explaining why this action is disabled for the current row?
For now, I've used a CSS selector to hide the option for specific rows
Hi @cosmick Good point! I can request that tooltip behavior. Given all of the customer feedback, we ended up shipping the ability to hide action buttons based on current row It's supported on Retool Cloud now. Since it's natively supported, I recommend switching to this new feature instead of custom css - which is tricky to maintain