2 Replies Latest reply on Dec 16, 2006 11:51 AM by swickes

    tree showRoot="false" will not hide the root folder

    swickes
      Dear Forum,

      I am loading a tree control with dynamically-generated xml. Everything is working fine, but adding showRoot="false" seems to have no effect!? In all cases I see the root node as the starting folder in the tree. I would like to hide it and show the four sub-folders instead.

      1. Yes, there is one (and only one) root node.
      2. I've tried naming this root note "node" (like all the other nodes)
      3. I've tried naming the root node "root"
      4. I given the root node a "label" attribute (and tried it without this attribute)
      5. Underneath the root node there are four "child" nodes.

      Any ideas will be appreciated,

      Thanks,
      Steve

        • 1. Re: tree showRoot="false" will not hide the root folder
          swickes Level 1
          More information (from the poster)

          I am using an xmlListCollection to populate the tree. The doc's say that xmlListCollections often don't have a single root and thus showRoot= has no effect. So I removed the root node and showRoot=false and now I get the error:

          TypeError: Error #1088: The markup in the document following the root element must be well-formed.

          So, to re-phrase the question: How can I use an xmlListCollection to populate a tree AND hide the root folder?

          • 2. Re: tree showRoot="false" will not hide the root folder
            swickes Level 1
            And more clues!

            Further testing reveals that showRoot="false" only works when the dataProvider is XML. It doesn't work when the dataProvider is an XMLLIst or XMLListCollection.

            I am under the impression I need the dataProvider to be an XMLListCollection if I want users to edit the tree. Assuming this is correct, I am stuck with the same question! How can I hide the root folder if I am using an XMLListCollection?

            Thanks in advance for your wisdom!