0 Replies Latest reply on May 6, 2007 4:27 PM by toddgeist

    transforming xml and DataGrids

    toddgeist Level 1
      Hello

      I am reading data from a large xml file. I read it in using HTTPService and the result type is "E4X". It contains information about items in a warehouse.

      like this

      <Inventory>
      <warehouse name="Texas">
      <chairs count="900"/>
      <tables count="40"/>
      <lamps count="200"/>
      </warehouse>
      <warehouse name="California">
      <chairs count="20"/>
      <tables count="200"/>
      <lamps count="1"/>
      </warehouse>
      </Inventory>




      So far I have been able to show a list of warehouses in a mx:List control and then when I select a warehouse (texas in this case) I would like to display the list of items and their counts in an mx:DataGrid control.

      I can see that I can use selectedItem of the mx:List to return the Node for the Texas warehouse like this


      <warehouse name="Texas">
      <chairs count="900"/>
      <tables count="40"/>
      <lamps count="200"/>
      </warehouse>


      But how can I get the data to display in a data grid


      ITEM COUNT
      chairs 900
      tables 40
      lamps 200


      Thanks

      Todd