Display Colour in table cell as component

Hello,

I’m developing an app that allows the user to set specific color to a record.

What I need to achieve is that the color should be displayed as a label in a table row containing specific record.

For example - if I have three columns in my table (Name, Phone, Status) - I’d like to add a color-component in fourth column (Name, Phone, Status, Color) as some kind of square or whatever.

Is there a component that will allow me to do that?

Thank you in advance
Tom

Hi,

one easy solution I’ve seen used a lot is a Label with ContentMode set to HTML and a suitable snippet as the Value. So something like

[code]

[/code](or maybe a instead of a
)

Then use the class name to add it suitable width and height in your theme.

-Olli

Thank you for the reply. I’ve managed to workaround my case by using disabled button, with CSS style injected dynamically. It’s not perfect, but does its job :slight_smile:

Nice :slight_smile:

You can even enable it for click events if you need them later.

-Olli

hmm, I’d never considered it that way :wink:

All the magic is to generate a column, inject dynamically CSS code containing button color and overriding ‘disabled’ style, so the button is not greyed out :wink:

And here it is:


30510.png