hi,
I need to use itemrender or something like this to display a value of GridColumn in a different color accordin his value
<s:GridColumn width="120" dataField="email_active" headerText="E-mail active">
<s:itemRenderer>
<fx:Component>
<s:GridItemRenderer>
<s:Label backgroundColor="{ data.email_active == 1 ? '#00ff00' : '#FF0000'}" />
</s:GridItemRenderer>
</fx:Component>
</s:itemRenderer>
</s:GridColumn>
email_active : is a data field from a table of my data base,
the data base is uploaded in datagrid using a php and this code :
<s:AsyncListView id="UserAsyn" list="{getUserResult.lastResult}"/>
I would suggest using an seperate GridItemRenderer and not one embeded in the GridColumn tag.
First reason, the Label value is only the size of the data length for that item, so setting the background color will only be for the label and not the entire cell.
Instead of changing the label, make a rectangle graphic item and set it to the width and height of the cell, then set the background color based on the data criteria.
Second reason is to avoid the issue of trying to put a String color value where a uint value is required.
I created and example for something similar, here is the Source View .
North America
Europe, Middle East and Africa
Asia Pacific