Ext JS 3:如何复制动态生成的treepanel? [英] Ext JS 3: How to copy a dynamically-generated treepanel?

查看:158
本文介绍了Ext JS 3:如何复制动态生成的treepanel?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Ext 3.3.1中有一个动态生成的 Ext.tree.TreePanel。看起来像这样:

I have a dynamically-generated Ext.tree.TreePanel in Ext 3.3.1. It looks like this:

-root
    -fruit
        -apple
    -vegetable
        -carrot

我需要制作这个树的副本/ STRONG>。我明白,ids将是不同的,没关系,但我希望文本和结构是一样的。

I need to make a duplicate/copy of this tree. I understand that the ids will be different and that's fine, but I want the text and the structure to be the same.

我目前的想法是递归地通过节点-by-node创建一个新树。有一个更快的方法?注意:有人非常有帮助地建议cloneConfig(),但我的理解是它不会捕获动态生成的树。这是一个混乱吗?

My current idea is to recursively go through and node-by-node create a new tree. Is there a faster way? NOTE: Someone very helpfully suggested cloneConfig(), but my understanding is that it will not capture a dynamically-generated tree. Is this confusion on my part?

感谢你的时间。

推荐答案

p>您可以使用cloneConfig()函数克隆任何ExtJS组件的配置。

You can make a clone of any ExtJS component's configuration using cloneConfig() function.

请参阅 Ext.Component 文档: http:// docs .sencha.com / ext-js / 3-4 /#!/ api / Ext.Component-method-cloneConfig

这篇关于Ext JS 3:如何复制动态生成的treepanel?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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