从ExtJS 3.0迁移到4.0 [英] Migration from ExtJS 3.0 to 4.0

查看:127
本文介绍了从ExtJS 3.0迁移到4.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以前在ext 3.0中,我们已经从XML响应构建了Tree Panel。
为了我们有扩展'Ext.tree.TreeLoader'的定制类
这个TreeLoader有助于构建树结构(父/子节点)。

Previously in ext 3.0 we had Tree Panel built from XML response. For that we had custom class extending 'Ext.tree.TreeLoader' This TreeLoader was useful to build tree structure (parent/child nodes).

当迁移到4.0时,发现TreeLoader类缺少。
有没有替换这个类或任何其他方式构建树结构?

While migrating to 4.0 found that TreeLoader class is missing. Is there any replacement to this class or any other way to build tree structure?

我想生成以下xml的树结构:
实际上,我想从这个XML构建树结构:

I want to generate tree structure for following xml : Actually, I want to build tree structure from this XML :

<?xml version='1.0' ?>
<Root>
<Folder>
<CreateDate>Apr 29, 2011</CreateDate>
<CreatedBy>1000</CreatedBy>
<Files/>
<FolderName>Testing</FolderName>
<FolderNamePath/>
<FolderPath/>
<Folders>
<Folder>
<CreateDate>Apr 6, 2011</CreateDate>
<CreatedBy>1000</CreatedBy>
<Files/>
<FolderName>JayM</FolderName>
<Folders>
<Folder>
<CreateDate>Apr 6, 2011</CreateDate>
<CreatedBy>1000</CreatedBy>
<Files/>
<FolderName>JaM</FolderName>
<Id>2000</Id>
<ModDate>Dec 30, 2011</ModDate>
<ParentFolderId>1948</ParentFolderId>
</Folder>
</Folders>
<Id>1948</Id>
<ModBy>1000</ModBy>
<ModDate>Dec 30, 2011</ModDate>
<ParentFolderId>1</ParentFolderId>
</Folder>

<Folder>
<CreateDate>Dec 2, 2011</CreateDate>
<CreatedBy>1000</CreatedBy>
<Files/>
<FolderName>demo folder</FolderName>
<Folders/>
<Id>2427</Id>
<ModBy/>
<ModDate/>
<ParentFolderId>1</ParentFolderId>
</Folder>

</Folders>
<Id>1</Id>
<ModBy/>
<ModDate/>
<ParentFolderId/>
</Folder>
</Root>

任何帮助都不胜感激。

推荐答案

您将需要查看 TreeStore ,以及任何标准Proxy(在您的情况下加上XmlReader),在Ext 4中替换了TreeLoader。TreeStore包含标准的Model实例(即记录)一个href =http://docs.sencha.com/ext-js/4-0/#!/api/Ext.data.NodeInterface =nofollow> NodeInterface 类提供树特定的行为。 API现在与标准存储/记录API非常相似,与3.x中的TreeLoader完全不同。

You'll want to look into the TreeStore which, along with any standard Proxy (plus XmlReader in your case), replaced TreeLoader in Ext 4. TreeStore contains standard Model instances (i.e., records) that have been decorated by the NodeInterface class to provide tree-specific behavior. The API is now very similar to the standard store / record API, unlike TreeLoader in 3.x which was completely separate.

查看树示例,具体来说是

Have a look at the tree examples, specifically the XML tree example in your case, for usage.

这篇关于从ExtJS 3.0迁移到4.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆