0 Replies Latest reply on Feb 5, 2008 8:51 AM by jaclayton

    Using XML to populate DataGrid Control

    jaclayton
      Hi,
      The code below is for a data grid that should display the contents of the XML file (sample below). However, when I run this from the Flex/Eclipse IDE, Firefox launches, hangs around for a second or two, then closes again. No grid is displayed, no data is shown. The XML file is pretty big (15000+elements) - could this be causing the problem?

      quote:

      <?xml version="1.0"?>
      <!-- DataGrid control example. -->
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml">
      <mx:Model id="logs" source=" http://localhost/ssmo_php/xmlLogSheet.xml"/>
      <mx:Panel title="DataGrid Control Example" height="100%" width="100%"
      paddingTop="10" paddingLeft="10" paddingRight="10">

      <mx:Label width="100%" color="blue"
      text="Select a row in the DataGrid control."/>

      <mx:DataGrid id="dg" width="100%" height="100%" rowCount="5">
      <mx:columns>
      <mx:DataGridColumn dataField="WEDate" headerText="Week Ending"/>
      <mx:DataGridColumn dataField="SheetNo" headerText="Sheet No."/>
      <mx:DataGridColumn dataField="LicenceNo" headerText="Licence No."/>
      <mx:DataGridColumn dataField="LandingPlace" headerText="Landing Place"/>
      <mx:DataGridColumn dataField="DateEntered" headerText="Date Entered"/>
      <mx:DataGridColumn dataField="EnteredBy" headerText="Entered By"/>
      <mx:DataGridColumn dataField="BoatName" headerText="Boat Name"/>
      <mx:DataGridColumn dataField="BoatRegNo" headerText="Reg No."/>
      </mx:columns>
      </mx:DataGrid>
      </mx:Panel>
      </mx:Application>


      quote:


      <logsheet>

      <data>
      <WEDate>2003-12-06</WEDate>
      <SheetNo>14692</SheetNo>
      <LicenceNo>34</LicenceNo>
      <LandingPlace>Scalloway</LandingPlace>
      <DateEntered>2004-05-04</DateEntered>
      <EnteredBy>Davie Riley</EnteredBy>
      <BoatName>Tussan</BoatName>
      <BoatRegNo>LK165</BoatRegNo>
      </data>
      </logsheet>

      And sorry for not finding the "Attach Code" button - first post here and it isn't obvious.