Hello All,Can i able to add color to Grid field row data Thanks,
Shubham
Discussion posts and replies are publicly visible
If you mean background colour, then no. But you could use a rich text field to colour the text itself. Beware: some colours work better than others.
Here's an example:
a!gridColumn( label: "Salary", sortField: "salary", value: a!richTextDisplayField( value: a!richTextItem( text: fv!row.salary, color: if( fv!row.salary>39999, "#ff0000", "#008000" ) ) ), align: "END" )
(note: you'd want to hold the literals used here - 39999, #ff0000 and #008000 in constants for maintenance and readability purposes)
In grid field we don't have a!gridColumn() function Can you please tell me about a!gridColumn()
Apologies, this is a 19.2 feature (available 31/5/2019). What version are you currently on?
ohh unfortunately i am using 19.1.Thanks for info.
To try and make up for my earlier blunder...you could use an Editable Grid - a!gridLayout() - where you can use the same idea as previously suggested - use Rich Text to provide the colour. You'd need to make the fields all read-only, and you cannot page the data, so it depends on whether the latter is a problem for you.
Only an addendum to this. You can page the data of an Editable Grid; it's exceptionally difficult and basically amounts to reinventing all the Appian paging controls from within Appian.
Hi Shubham,
You can try this
a!forEach( items: {1,2,3}, expression: { a!cardLayout( style:if( fv!index=2, "WARN", "STANDARD" ), contents: { a!gridField( shadeAlternateRows:false(), spacing:"DENSE", borderStyle:"LIGHT", totalCount: 1, columns: { a!gridTextColumn(
field: "c10", data: "Test1" ), a!gridTextColumn(
field: "c16", data:"Test2" ), a!gridTextColumn(
field: "c12", data: "Test3" ),
}, value: a!pagingInfo(1,-1) ) } )
})