如何使用 Designer 1.2 为 treePanel 配置 ExtJS 4.0 xmlTreeStore?
xml treePanels 的教程太简单了。我不知道我想要的是否可能。我想要的是看到一棵树,其根文件夹名为“contenttype”(或者简单地“root”是可以接受的)。根文件夹内有一个名为“config”的文件夹,其中应包含任意数量的名为“block”的文件夹,并且每个块文件夹内应包含任意数量的“input”节点。下面是一个典型的 XML 输入,它应该生成上述树结构。请注意,树应该忽略“form”和“title”节点以及“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>
此外,我希望块文件夹的名称与块节点的名称属性相同,并且 treePanel 中的输入节点的名称与 XML 中输入元素的名称属性相同。
我尝试了 TreeStore、Ajax 代理、Xml Reader 和字段的各种配置。我最终得到了一个根文件夹和两个名为“未定义”的文件夹,但它们没有出现在预览中或当我在浏览器中加载页面时。此外,它显示已加载记录,但没有像其他数据存储那样说明加载了多少条记录。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论