I don't understand what you mean.

I extended the Text class for my ItemRenderer.

Here is my item renderer class:

package renderers
{
     import mx.controls.*;
     import mx.controls.dataGridClasses.DataGridListData;
     import mx.utils.StringUtil;
     import flash.display.Graphics;

     public class ProblemsCellField extends Text
     {
         private var fieldValue:String;

         public function ProblemsCellField()
         {
             super();
         }

         override public function set data(value:Object):void
         {
             if(value != null)
             {
                 super.data = value;
                 fieldValue =
value[DataGridListData(listData).dataField];

                 text = StringUtil.trim(fieldValue);
             }
         }

         override protected function
updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
         {
             super.updateDisplayList(unscaledWidth, unscaledHeight);
             var g:Graphics = graphics;
             g.clear();
             g.beginFill(0xBBBBBB);
             g.drawRect(0, -2, unscaledWidth, unscaledHeight + 4);
             g.endFill();
         }
     }
}

And to use it:

<mx:DataGridColumn id="PS1Column" headerText="PS1" dataField="PS1"
width="60" sortable="true" textAlign="left"
itemRenderer="renderers.ProblemsCellField"/>


HTH.



Steve

--- In [email protected], "vitaly.nikolenko" <v...@...> wrote:
>
> yes, but there's no
> updateDisplayList
> in parent DataGridItemRenderer class
> Which else method can i override to draw graphics and use valid with
and height?
>
>
>
> --- In [email protected], "valdhor" valdhorlists@ wrote:
> >
> > As I understand it, there is no backgroundColor style. What I did
was
> > use a graphic fill:
> >
> >          override protected function
> > updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
> >          {
> >              super.updateDisplayList(unscaledWidth, unscaledHeight);
> >              var g:Graphics = graphics;
> >              g.clear();
> >              g.beginFill(0xBBBBBB);
> >              g.drawRect(0, -2, unscaledWidth, unscaledHeight + 4);
> >              g.endFill();
> >          }
> >
> >
>

Reply via email to