开发者

Advanceddatagrid cell fill

开发者 https://www.devze.com 2022-12-22 19:11 出处:网络
How a particular cell can be f开发者_高级运维illed with any color in advanced data grid.If you meant column:

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

精彩评论

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

关注公众号