sweet…that works….thank you very much Tim….appreciate your help and time.

 

Thanks,

Subba

 

 

 

From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Tim Hoff
Sent: Thursday, June 15, 2006 12:07 PM
To: [email protected]
Subject: [flexcoders] Re: DataGridColumn Item Renderer

 

In place of:

if (data.accountBalance < 0)
{
accountBalance.setStyle("color","red");
}

Use something like this:

switch(data.yourDataField) {
case "Sunday":
yourItemRendererField.setStyle("color","red");
break;
case "Monday":
yourItemRendererField.setStyle("color","blue");
break;
case "Tuesday":
yourItemRendererField.setStyle("color","green");
break;
case "Wednesday":
yourItemRendererField.setStyle("color","purple");
break;
default:
yourItemRendererField.setStyle("color","black");
}

-TH

--- In [EMAIL PROTECTED]ups.com, "Tim Hoff" <[EMAIL PROTECTED]> wrote:
>
> Subba,
>
> The itemRenderer, in the example, checks each individual row one
at
> a time as it renders. That's why the example has some red and
some
> black row items. You can use this method to set your columns'
> individual row items to any color conditionally. Maybe, I'm not
> understanding exactly what you are trying to do.
>
> Tim
>
> --- In [EMAIL PROTECTED]ups.com, "Subba Chalamalasetty"
> <subba@> wrote:
> >
> > Hi Tim,
> >
> > I checked the example. Again it is checking the entire column
data
> and
> > setting the color..
> >
> > public function init():void
> > {
> > if (data.accountBalance < 0)
> > {
> > accountBalance.setStyle("color","red");
> > }
> > }
> >
> > I am planning to write a loop like(while or for)
> > While(data.accountBalance is not empty)
> > Change the color for each element i.e .setStyle("","");
> >
> > Thanks,
> > Subba
> >
> > .
> >
> > ________________________________
> >
> > From: [EMAIL PROTECTED]ups.com
> [mailto:[EMAIL PROTECTED]ups.com] On
> > Behalf Of Tim Hoff
> > Sent: Thursday, June 15, 2006 10:53 AM
> > To: [EMAIL PROTECTED]ups.com
> > Subject: [flexcoders] Re: DataGridColumn Item Renderer
> >
> >
> >
> > Hi Subba,
> >
> > Here is a very simple example of how to do that:
> >
> > http://www.cflex.net/showfiledetails.cfm?
> ChannelID=1&Object=File&objectI
> > D=443
> > <http://www.cflex.net/showfiledetails.cfm?
> ChannelID=1&Object=File&object
> > ID=443>
> >
> > You can right-click on the example to see the code. I hope that
> this
> > helps you,
> > Tim Hoff
> >
> >
> > --- In [EMAIL PROTECTED]ups.com, "Subba Chalamalasetty"
<subba@>
> > wrote:
> > >
> > > I have a data grid and there are 10 columns and 5 rows in
that.
> I am
> > > trying to use itemRenderer = "myRenderer"
> > >
> > > ----- myRenderer.mxml ------
> > >
> > >
> > >
> > > <?xml version="1.0" encoding="utf-8"?>
> > >
> > > <mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml">
> > >
> > > <mx:Label textAlign="right" text="{data.name}" alpha="0.1"
> > > color="#ff0033" width="100%" />
> > >
> > >
> > >
> > > </mx:VBox>
> > >
> > >
> > >
> > > I want to have different colors for each name. In the above
> code, as i
> > > am giving {data.name}, I am getting all the names with same
> color.
> > >
> > >
> > >
> > > I want to access each element(cell) in that column(column
> name=name)
> > and
> > > give each name with different color. Can somebody help me with
> this?
> > >
> > >
> > >
> > > Thanks
> > >
> >
>

__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




__,_._,___

Reply via email to