How a particular cell can be f开发者_高级运维illed with any color in advanced data grid.
If you meant column:
<mx:AdvancedDataGridColumn
backgroundColor="#00ff00"
dataField="data_field"
headerText="The Header"/>
In case you really need to color a cell, use a custom item renderer, and add the bgColor
to the data provider.
<mx:AdvancedDataGridColumn
itemRenderer="path.to.MyTextInput"/>
<!-- path/to/MyTextInput.mxml -->
<mx:TextInput xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script>
<![CDATA[
override public function set data(value:Object):void
{
super.data = value;
this.text = value.dataField;
this.setStyle("backgroundColor", value.bgColor);
}
]]>
</mx:Script>
</mx:TextInput>
精彩评论