1 Reply Latest reply on Sep 27, 2009 11:28 PM by drillnaut

    Tree open empty node

    drillnaut

      Hello Everyone ,

          I have a tree mimicking a file system.  I want the tree to only show the directories , not files. Unfortunately , if a node has no children that are directories , the Tree control will not show a disclosure icon , nor allow that node to be opened . My FileModel object stores directory type children in a "children" variable , and the directories plus files in an "allchildren" collection.  I implement ITreeDataDescriptor in my FileModel , but modifying the hasChildren and getChildren functions to work off of "allChildren" is fruitless.  For some reason , Flex goes straight for the content of the "children" collection variable.

                     So there are 3 ways to solve the problem.  One: Make certain types of children non-renderable (not just an empty row) in the tree , or Two: Force Flex to open/animate/disclosure nodes with no directory children , or 3 Force Flex to pay attention to the hasChildren , getChildren functions I implemented in the file model.   I tried manually setting the icon for childless files , but it gets pretty messy because I need a whole nother data structure to keep track of which files can be animated , which ones cant , and which ones are opened/closed.

       

      Sincerely ,

      D