Add class to Action buttons in table

In the action column, I have a single button {Delete/Configure}. I want to change the color from {Configure=Blue} to {Delete=red} on click. As all the action buttons have the same classes, it's not working. I want to add a class to the button {.delete} on click to change its color. it would be good if it can be done

Hey @praveen!

We have a ticket open to include more action button styling and we can let you know here when that is supported. In the meantime, you might try using a custom button column that renders HTML. Here's a rough pass:

It also uses the following custom CSS:

button.minimal-hover{
  padding: 0;
}

It may be useful to use some preloaded JS functions to help de-clutter the value field itself. Let me know if that helps or raises additional questions!

Hi,

Has action button has option to change the style of it already?
I need to get "Delete" button in the table and I need it to be red and smaller then it is originally. Is there an option to achieve this?

Hey @mondob!

Do you happen to have an image of what you'd want it to look like?

Styling for action buttons currently isn't supported but in the new table component each column type supports a cell click event handler meaning any cell type can act much like buttons would so there are a number of potential workarounds (below are a few):

Hello! Just a heads up that, over the next couple of weeks the dev team will be rolling out the button column type for the new table :tada:

The plan is for it to come with some basic styling options for color that will hopefully address the issues raised here!

1 Like

@Kabirdas Great to hear! I've just been searching the forums for the best way to do this and was a bit confused as to what I could use on the new table component. for now I'm thinking to just use an icon field that opens a hidden modal with Confirm/Cancel and using .selectedRow.id to for the delete.

Unless you have a better suggestion?

I've been away from Retool for a bit but we are now onboarded finally and I'm actively developing 3 different initial Apps :slight_smile:

Thanks!
Nick

1 Like

@nickaus Glad you've found several use cases for Retool apps :tada: Another feature that could be helpful is adding a confirmation modal to a query so that the user can confirm if they want the triggered query to actually run. You'll find this setting in the advanced section of each query:

Oh thanks @Tess
I'd actually added some 'manually', I was not aware of this feature. That will save a lot of time :sunglasses:

Regards,
Nick

1 Like