2 Replies Latest reply on Nov 17, 2009 1:04 PM by madhooper

    Tree and DataGrid from shared XML data

    Josh Johnson Level 1
      So instead of an answer to a specific problem, I'm hoping I can get some ideas for different approaches to a problem. I'm going to be building essentially a file explorer in flex, where there a tree at the left to show the folder hierarchy, and a datagrid on the right to show the contents of any selected node in the tree.

      I have total control over the data provider for this, but I'm somewhat torn as to how to approach it. My initial thought was that I'd have a single XML file that displayed the hierarchy and all the included children as simple refs, and then a second XML file for specific detail data about each child item and link the two via the refs. I still think that's the right way to go, but I'm unsure as to how to:

      a) strip all the non-folder children from the dataProvider for the tree,
      b) how to link the tree to the datagrid, such that the datagrid only presents the immediate children of the current tree selection, and
      c) how to populate the dataGrid with data from the second XML file, based on the refs being provided from the first (as described in b).

      Ok, so if it's not obvious, I'm probably in over my head here. Has anyone done something remotely (or even exactly) like this before? If so, can I get some tips on the best way to approach the problem?
        • 1. Re: Tree and DataGrid from shared XML data
          ntsiii Level 3
          I have a sample app that loads an xml file from the server, displays the nodes in a tree, and when you select a node, it displays the node attributes in a dataGrid.

          In this case, all the data is in a single xml structure. This sounds similar to what you are going for and may have techniques you can use. If you want a copy send me an email directly.

          Another approach is to have the change event of the tree invoke a send() on a data service, passing in the key information from the node, that returns the data specific to that node.

          I haven't done enough with tres in 2.0 to tell you how to selectively dsplay nodes.


          • 2. Re: Tree and DataGrid from shared XML data
            madhooper Level 1

            I have this same issue. Would you mind sharing your code with me as well?


            Thanks in advance.


            My email is dameon@dameonbryant.com