Well Naveen, you have to override the set data method like. This oldObject
will hold the last set data Object..

private var oldObject : Object;
public function set data(value : Object){
super.data =value;
if(oldObject){
if(oldObject.highPrice > value.highPrice){
someComponent.setStyle("backgroundColor","#FF00000")
}else{
someComponent.setStyle("backgroundColor","#00FF00")
}

oldObject =data;
}

On Wed, Mar 23, 2011 at 9:47 AM, Shalu <[email protected]> wrote:

> Hi Naveen,
>
> As per my understanding, you should maintain two arrayCollections, one
> dataGridDataProvider and the sceond one say originalData, whenever u
> get new data, you should get in original data, and then you can
> comapre it with datagridDataProvider's values and you can maintain one
> more field for coloring purupose e.g. "valueChange" in
> datagridDataProvider's objects, if you want the item to be colored
> then set the value of valueChange to true else false.
>
> and as your dataGridDataProvider is binded with datagrid, the item-
> renderer will check the value of  valueChange  property and set the
> color accordingly.
>
> hope this suggestion will help you to resolve your query.
>
> Thanks & Regards,
> Shalu
>
> On Mar 22, 7:57 pm, nav <[email protected]> wrote:
> > Hi Friends,
> >
> > I have a question on the implementation of a specific use case which
> > is as follows:
> >
> > 1) I have a data provider of ArrayCollection of some custom class
> > called StockVO which is bound to a datagrid. Say the values initially
> > received from the server are 1,2,3,4,5 on a column StockValue from the
> > respective  classes.
> >
> > 2) At regular interval by polling I have an updated ArrayCollection
> > coming in from the server. With the new set of dataprovider, I require
> > to compare with the old values against the same specific beans and
> > change the color of the cell in the datagrid,
> >
> >  ie Say the 0th element of StockVO class in the array collection had
> > value 5 the first time.
> >
> > The new Array Collection has the same Object updated to say 6, I need
> > to change the cell color to green.
> >
> > Questions I have for the implementation of such a use case of Stock
> > Application is:
> >
> > 1) How do I compare the previous values to new values? Do I use UUID
> > in each of the bean?
> >
> > 2) How do I retain the old Arraycollection and compare this with the
> > new value?
> >
> > 3) If I had to use Item Renderer for this operation to selectively
> > change color how do I pass the data knowledge on the previous and
> > current value at the same time?
> >
> > Thanks in advance for the help folks.
> >
> > Cheers,
> > Naveen
>
> --
> You received this message because you are subscribed to the Google Groups
> "Flex India Community" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/flex_india?hl=en.
>
>


-- 
Thanks and Regards,
JJain,

   If you have knowledge, let others light their candles in it --Margaret
Fuller:

-- 
You received this message because you are subscribed to the Google Groups "Flex 
India Community" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/flex_india?hl=en.

Reply via email to