0 Replies Latest reply on Feb 12, 2007 4:12 AM by jryan76

    Using data in an ArrayCollection


      I'm very new to Flex and hope someone advise me on this or tell me if it's even possible!

      My Flex application is pulling data using a php page. The data is then parsed into XML and is placed inside an ArrayCollection called custData. My DataGrid is then using custData as it's dataProvider. This is all working and my Datarid displays my two colmuns (cust & status).

      What I need to be able to do though is to check the values in my status column and if any of these change to '2' then trigger an event (at the moment this could just be to display some text).

      I know (unless someone tells me otherwise) that I need an If statement to check the values of status in my ArrayCollection but I need to know how you access just the values of status and if one has changed to '2' then to display the text.

      I'd really appreciate if someone could point me in the right direction. Thanks in advance. If it makes anything clearer then my code is below.


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

      import mx.collections.ArrayCollection;
      import mx.rpc.events.ResultEvent;

      private var custData:ArrayCollection;

      private function resultHandler(event:ResultEvent):void {
      custData = event.result.cstatus.customer;

      <mx:HTTPService id="custRequest"
      url=" http://localhost/FlexTest/retrieve.php"

      <mx:DataGrid dataProvider="{custData}">
      <mx:DataGridColumn headerText="Customer" dataField="cust"/>
      <mx:DataGridColumn headerText="Status" dataField="status"/>