0 Replies Latest reply on Apr 11, 2010 12:48 PM by olivier.H

    Change background color of row in an advanceddatagrid

    olivier.H

      Hi,

       

      I've been desperatly trying to change the background color of a row in an advanceddatagrid.

      What I'm trying to achieve is:

      1) my ADG contains a list of items

      2) One of my item changes due to a notification from the backend (from a JMS)

      3) I want to change the background color of the row that contains this item in order to show the user that this item has been updated.

       

      Here is how I tried to do that

      1) I've attached a callback that fires when the the item

      2) I try to get the row that contains this item in my ADG... and i try to get access to some property that allows me to change the bgcolor. But I can't!

       

      Here is my code that does that:

       

      public override function onRendereeChanged(evt:Event):void
              {
                  var evtColl:CollectionEvent = (evt as CollectionEvent)
                  if (evtColl!=null)
                  {
                      if ((evt as CollectionEvent).kind == CollectionEventKind.UPDATE)
                      {
                          //get the datagrid item
                          for (var ii:int;ii<(this.m_resultGrid.dataProvider as ArrayCollection).length;ii++)
                          {
                              if (((evtColl.items[0] as PropertyChangeEvent).source as IEntity).Identifier ==
                              ((this.m_resultGrid.dataProvider as ArrayCollection).getItemAt(ii) as IEntity).Identifier)
                              {
                                  //What do I do here on my Item!!!!!
                              }
                          }
                      }
                  }
              }  

       

      Do you any other idea about I could do that?

       

      Thank you for your help!