3

The tutorials for xml treePanels are too simple. I don't know if what I want is even possible. What I want is to see a tree with a root folder called "contenttype" (or simply "root" is acceptable). Inside the root folder is one folder called "config" and inside of that should be any number of folders called "block" and within each block folder should be any number of "input" nodes. Below is a typical XML input that should produce the tree structure described above. Notice the tree should ignore the "form" and "title" nodes as well as the child nodes of "input".

<contenttype>
  <config name="Person" version="1.0">
    <form>
      <title name="last-name"/>
      <block name="Personal info">
        <input name="last-name" type="text" required="true">
          <display>Last name</display>
          <xpath>contentdata/last-name</xpath>
          <help>Enter the last name</help>
        </input>
        <input name="first-name" type="text" required="true">
          <display>First name</display>
          <xpath>contentdata/first-name</xpath>
          <help>Enter the first name</help>
        </input>
        <input name="personal-history" type="textarea" required="true">
          <display>Personal history</display>
          <xpath>contentdata/personal-history</xpath>
          <help>Enter relevant information</help>
        </input>
      </block>
      <block name="Pictures" group="contentdata/pictures">
        <input name="portrait" type="image">
          <display>Portrait picture</display>
          <xpath>contentdata/portrait</xpath>
          <help>Should be a passport type picture</help>
        </input>
      </block>
    </form>
  </config>
</contenttype>

Furthermore, I would like the name of the block folders to be the same as the name attribute of the block nodes and the name of the input nodes in the treePanel to be the same as the name attribute of the input elements in the XML.

I tried all sorts of configurations for the TreeStore, Ajax Proxy, Xml Reader and fields. I eventually got a root folder and two folders named "undefined" but they did not appear in the preview or when I loaded the page in a browser. Also, it says records loaded but does not say how many the way other datastores do.

Rubicksman
  • 322
  • 1
  • 2
  • 11
  • got the code you tried? do you have the ability to transform this with your middleware (aka backend), or is this the end product from someone elses code? – Dawesi Dec 03 '13 at 15:24
  • do you want something like this? http://postimg.org/image/3qchvl84t/ – Raza Ahmed Jan 02 '14 at 05:47

0 Answers0