2010-03-15 6 views

Répondre

1

Si vous vouliez dire la colonne:

<mx:AdvancedDataGridColumn 
    backgroundColor="#00ff00" 
    dataField="data_field" 
    headerText="The Header"/> 

Dans le cas où vous avez vraiment besoin de colorer une cellule, utilisez un moteur de rendu d'élément personnalisé et ajoutez le bgColor au fournisseur de données.

<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> 
Questions connexes