Hi,
We have a requirement to change the background color of the grid row based on certain conditions.
Looking for something like a!gridRowLayout(color:"POSITIVE", contents:{}).
Any suggestions?
Note: Not the text color using a!richtextdispaly field().
Thanks,
Manjunath
Discussion posts and replies are publicly visible
Hi Manju,
I quite liked the idea given by Stefan here to create custom coloured grid with the help of card layout. If you wanna give a try, below is the code to try it out:
a!localVariables( local!red: true, local!green:true, { a!columnsLayout( columns: { a!columnLayout( contents: { a!cardLayout( contents: {}, height: "EXTRA_SHORT", style: "NONE", marginBelow: "NONE" ), a!cardLayout( contents: {}, height: "EXTRA_SHORT", style: "NONE", marginBelow: "NONE" ) }, width: "NARROW" ), a!columnLayout( contents: { a!cardLayout( contents: {}, height: "EXTRA_SHORT", style: if(local!red,"ERROR","NONE"), marginBelow: "NONE" ), a!cardLayout( contents: {}, height: "EXTRA_SHORT", style: "NONE", marginBelow: "NONE" ) }, width: "NARROW" ), a!columnLayout( contents: { a!cardLayout( contents: {}, height: "EXTRA_SHORT", style: if(local!green,"SUCCESS","NONE"), marginBelow: "NONE" ), a!cardLayout( contents: {}, height: "EXTRA_SHORT", style: "NONE", marginBelow: "NONE" ) }, width: "NARROW" ), a!columnLayout( contents: { a!cardLayout( contents: {}, height: "EXTRA_SHORT", style: "NONE", marginBelow: "NONE" ), a!cardLayout( contents: {}, height: "EXTRA_SHORT", style: "NONE", marginBelow: "NONE" ) }, width: "NARROW" ), a!columnLayout( contents: { a!cardLayout( contents: {}, height: "EXTRA_SHORT", style: "NONE", marginBelow: "NONE" ), a!cardLayout( contents: {}, height: "EXTRA_SHORT", style: "NONE", marginBelow: "NONE" ) }, width: "NARROW" ), a!columnLayout( contents: { a!cardLayout( contents: {}, height: "EXTRA_SHORT", style: "NONE", marginBelow: "NONE" ), a!cardLayout( contents: {}, height: "EXTRA_SHORT", style: "NONE", marginBelow: "NONE" ) }, width: "NARROW" ) }, spacing: "NONE", showDividers: true ) } )