开发者

Advanceddatagrid cell fill

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>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜