3 Replies Latest reply on May 4, 2009 7:01 PM by ntsiii

    XML to Hierarcichal data in Flex

    rjoshicool Level 2

      I need to read data from an external XML file and convert it into Hierarcichal data, so that it can form a tree like node structure but i am not able to figure out what should be the XML structure so that it can be organized into HierarcichalData. THis HierarcichalData object will be the dataprovider of an Advanced DataGrid.

        • 1. Re: XML to Hierarcichal data in Flex
          Srirangan Level 2

          You mean somethind like this:

           

          <node label="parent1">

               <node label="child1"/>

               <node label="child2"/>

               <node label="child3"/>

          </node>

           

          <node label="parent2">

               <node label="child1"/>

               <node label="child2"/>

               <node label="child3"/>

          </node>

           

          <node label="parent3">

               <node label="child1"/>

               <node label="child2"/>

               <node label="child3"/>

          </node>

          1 person found this helpful
          • 2. Re: XML to Hierarcichal data in Flex
            rjoshicool Level 2

            I want to form a structure similar to this one:

            advDG.jpg

             

            Curently I can achieve this structure by using something like this:

            private var dpa:ArrayCollection = new ArrayCollection([
                    {childSkill:"Parent", child: [
                   
                    {childSkill:"First Child", relationType:"Parent-Child Relationship", description:"Some Description", child: [
                    {childSkill:"First Sub Child", relationType:"Child-Sub Relationship", description:"Some Description", child: [
                    {childSkill:"First Sub Child", relationType:"Child-Sub Relationship", description:"Some Description"}]},
                    {childSkill:"Second Sub Child", relationType:"Child-Sub Relationship", description:"Some Description"}]},
                           
                    {childSkill:"Second Child", relationType:"Parent-Child Relationship", description:"Some Description", child: [
                    {childSkill:"Third Sub Child", relationType:"Child-Sub Relationship", description:"Some Description"},
                    {childSkill:"Fourth Sub Child", relationType:"Child-Sub Relationship", description:"Some Description"}]}
                           
                    ]}
                    ]);

            Then i set the source of the Hierarcichal data to this Array Collection. But i want to read an XML file and create such a structure.