Using coloured Tag in Table

Hi

I have a table showing customer data. One of the fields is the customer status (e.g. Active / Inactive). Based on this I want to use the "Tag" field type and colour the customer id field appropriately e.g. Active = Green / Inactive = Red.

I've set some JS as you can see in the image, it appears to evaluate to the correct colour based on the customer status however the tag remains grey.

If I colour code the actual status field using the "item" keyword it seems to work correctly (see the second screenshot). Is there any way of making this work on customer id?

Thanks in advance
Rob

Hi @Rob_Faulkner Thanks for reaching out! Unfortunately, this is a bug where currentRow is not in scope for the tag colors :disappointed:

Background color does have currentRow in scope, so your original logic would work in this field. Definitely not a perfect workaround, but wanted to share just in case while we work on a fix for the bug!

Thanks Tess, I’d spotted the background colour could be changed … but it just doesn’t look as pretty :grinning:

Thanks for your time looking into it. I’ll hold out for the big fix.

Cheers,

If you don't use all the functionality of the table component then the virtualised table does have this option and might be a good alternative

Hi @dcartlidge,

Thanks for the pointer, although Im not sure where the "virtualised table" is? I've looked through all the available components / Googled and can't see one?

Cheers,

Thanks @dcartlidge! @Rob_Faulkner virtualized table is a component in Private Beta. I've added it to your account. Please note that is read-only and doesn't yet have much functionality in terms of filtering or server side pagination. If you don't need users to edit table cells, this could potentially be a good option!

Ah that’s great, I’ll take a look this morning.

Thanks both!

Virtualised table works great, thanks again @dcartlidge @Tess

oops, my bad, I had read it was coming out of Beta and assumed it was available - glad it worked out for you though