1 Reply Latest reply on Apr 10, 2011 11:48 PM by Flex harUI

    Hiding nodes in a tree keeping the children visible

    flex2008 Level 3

      I have a tree with a dataprovider which takes the following form:

       

      <details name="Cars">
          <contact_person>aaaa</contact_person>
          <list>
              <car type="A">
                  <car name="A1"/>
                  <car name="A2"/>
              </car>
              <car type="B">
                  <car name="B1"/>
                  <car name="B2"/>
              </car>
          </list>
      </details>
      

       

      I want the tree to be shown like this

       

      Cars

           A

                A1

                A2

           B

                B1

                B2

       

      That is I want to hide the contact_person and list nodes.Deleting the nodes from the dataprovider cannot be done.So what i did was to create a custom tree data descriptor by extending DefaultDataDescriptor.Then override the getChildren method and applied a filterfunction to the collection returned by super.getChildren.The problem is when i hide the 'list' node I cannot have the child nodes to show up.So is there any way I can hide 'list' but show the children of 'node'?