1 Reply Latest reply on Mar 23, 2008 9:28 PM by Sreenivas R

    Help moving to Flex 3 using AdvancedDataGrid

    leeng Level 1
      I am just moving over to Flex 3 and want to use the AdvancedDataGrid and I can't seem to get it to read the lastResult of an HTTPService.

      if I use dataProvider="{studXML.lastResult.student}" I get stuff in the grid but it's not hierarchical (no folder opening to see children nodes)

      if I use dataProvider="{new HierarchicalData(studXML.lastResult.student)}" I get no data in the grid

      I tried messing with the resultFormat of the HTTPService but nothing seems to work (it seems it has to be e4x just to get some data displayed)

      Am I missing some new behavior with the AdvancedDataGrid? (code and data below)

      I appreciate any clues. Thanks.

      be well,

      My Code:

      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="studXML.send();">
      <mx:HTTPService id="studXML" resultFormat="e4x" url=" http://localhost/~hoytng/Workspace/studentDB/xml/student.xml"/>

      <mx:AdvancedDataGrid dataProvider="{studXML.lastResult.student}" x="10" y="306" id="adg1" designViewDataType="tree" width="1004" height="452">
      <mx:AdvancedDataGridColumn headerText="Student Name" dataField="@studname"/>
      <mx:AdvancedDataGridColumn headerText="Notes" dataField="notes"/>
      <mx:AdvancedDataGridColumn headerText="Curriculum" dataField="@currid"/>
      <mx:AdvancedDataGridColumn headerText="Class Name" dataField="@klassname"/>
      <mx:AdvancedDataGridColumn headerText="Date" dataField="@date"/>

      My Data:

      <student studname="fred flintstone">
      <notes><![CDATA[Can't feed his brontosaurus]]></notes>
      <curriculum currid="1" currname="curricula B">
      <class klassname="klass A" sched="no" take="no" date="" inst=""/>
      <class klassname="klass B" sched="no" take="no" date="" inst=""/>
      <class klassname="klass C" sched="no" take="no" date="" inst=""/>
      <class klassname="klass D" sched="no" take="no" date="" inst=""/>
      <student studname="barney rubble">
      <notes><![CDATA[This is about dinosaurs]]></notes>
      <curriculum currid="2" currname="curricula A">
      <class klassname="klass A" sched="yes" take="no" date="01252008" inst="jim jestson"/>
      <class klassname="klass B" sched="yes" take="yes" date="01262008" inst="bob hope"/>
      <class klassname="klass D" sched="no" take="no" date="02142008" inst="mr hooper"/>
      <class klassname="klass F" sched="yes" take="no" date="02162008" inst="mr rogers"/>