3 Replies Latest reply on Sep 15, 2010 12:23 AM by gl@hw

    ItemRenderer Issue with DataGrid and Label

      <mx:DataGrid width="100%" height="100%" rowCount="5" dataProvider="{publish_status}">
                <mx:DataGridColumn dataField="status" headerText="Status">
                               <mx:Label text="{data.status}" fontSize="12">
                                         override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void {
                                         super.updateDisplayList(unscaledWidth, unscaledHeight);
                                         if(this.text == "A"){
                                              setStyle("color", "blue");
                                         else if(this.text == "B"){
                                                   setStyle("color", "green");
                                         else if(this.text == "C"){
                                              setStyle("color", "red");



      I created an inline ItemRenderer as above. I understand that it gets recycled and have included the last "else" statement to return color to default if all tests fail.  The problem is that the text is still showing up in the wrong colors.  I have done a lot of reading on the forums but I can't figure out what I'm missing.


      Btw, I am using Flash Builder 4.