开发者

How do I configure an ExtJS 4.0 xmlTreeStore for a treePanel with Designer 1.2?

开发者 https://www.devze.com 2023-04-07 20:59 出处:网络
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)

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" a开发者_运维问答nd "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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号