I’m expecting you to adapt from what I posted.  Go through your rows and as you find the entries that need the background color adjusted execute the setPropertiesAt code.  You can also simply update the backgroundColor property on those objects and then re-assign the dataProvider, it should attempt to follow what you did.  You can do this in an intermediary step between when the data was received and when you assign it to the DataGrid (for example in a result handler).

 

Matt

 


From: [email protected] [mailto:[email protected]] On Behalf Of greenfishinwater
Sent: Wednesday, October 12, 2005 11:08 AM
To: [email protected]
Subject: [flexcoders] Re: How to selectively color specific rows in a data grid

 

Matt,

I follow your code example. It seems that you have hard coded the row
that you need a different color. In my case I may have 100s of rows
and there could be over 50% of these to be highlighted. Also you have
done it after the grid has been created, what happens if the data set
is refreshed with new new data.

Andrew

--- In [email protected], "Matt Chotin" <[EMAIL PROTECTED]> wrote:
>
> From Deepa way back in the day:
>

>
> <?xml version="1.0" encoding="utf-8"?>
>
> <mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml">
>

>
> <mx:Script>
>
>             var dp = [{Title: "Email", Date: "November"}, {Title:
> "View", Date: "May"}, {Title: "View", Date: "May"}, {Title: "View",
> Date: "May"}];
>
> </mx:Script>
>

>
> <mx:DataGrid id="dg" width="300" height="250" dataProvider="{dp}"
> creationComplete="dg.setPropertiesAt(3, {backgroundColor:0xFF0000});"/>
>

>
> </mx:Application>
>

>

>
> Matt
>

>
> ________________________________
>
> From: [email protected] [mailto:[email protected]] On
> Behalf Of greenfishinwater
> Sent: Wednesday, October 12, 2005 10:37 AM
> To: [email protected]
> Subject: [flexcoders] How to selectively color specific rows in a data
> grid
>

>
> I have a remote object returning a set of rows to display in a data
> grid. One of the returned rows is a flag (0 or 1) indicating that a
> monitored column in the grid has a value that is of special interest.
> When a row has the flag set, I want the whole row to be of a different
> color.
>
> What is the best way, I initially looked at some examples of a cell
> renderer, but was put off by the complexity. Is there an easier way?
>
> Thanks Andrew
>
>
>
>
>
>
> --
> Flexcoders Mailing List
> FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> Search Archives:
> http://www.mail-archive.com/flexcoders%40yahoogroups.com
>
>
>
>
> ________________________________
>
> YAHOO! GROUPS LINKS
>

>
> *      Visit your group "flexcoders
> <http://groups.yahoo.com/group/flexcoders> " on the web.
>        
> *      To unsubscribe from this group, send an email to:
>       [EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]>
>        
> *      Your use of Yahoo! Groups is subject to the Yahoo! Terms of
> Service <http://docs.yahoo.com/info/terms/> .
>

>
> ________________________________
>







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




YAHOO! GROUPS LINKS




Reply via email to