Hi i got this tag component, any chance to have custom color ? depending on a value in a mysql db? if Active then color should be green, if inactive then should be Red
thank you
Hi i got this tag component, any chance to have custom color ? depending on a value in a mysql db? if Active then color should be green, if inactive then should be Red
thank you
Hi @agaitan026
It depends if you are using Manual or Mapped options when it comes to connecting the data source.
If you are using mapped option you can set it in Mapped tags using ternary operator like this
I have different options as im using self host version, maybe i should wait updates?
Could you try with the ternary operator in Tag colors, where it now has {{theme.automatic}} ?
{{ item === 'ACTIVO' ? theme.success : item === 'SUSPENDIDO' ? theme.danger : 'transparent' }}
would trying Styles option for color work instead? Not sure what options are available to you there
it works like that i put tags1.value but now its not getting the correct color of theme.sucess should be green not red i got only two tags ACTIVO and SUSPENDIDO
Hi @agaitan026! It looks like @Milan_Kalem has just about solved your problem but I wanted to hop in and hopefully get the last bit of functionality implemented.
I'm pretty sure tags1.value
should return an array, given that the "Tags" component can hold multiple elements. As such, your ternary should reference tags1.value[0]
instead of just tags1.value
. I hope that helps!
If you do want to use the newer version of the "Tags" component, you should upgrade to at least version 3.72!