开发者

Ext JS 3: How to copy a dynamically-generated treepanel?

开发者 https://www.devze.com 2023-03-25 00:50 出处:网络
I have a dynamically-generated Ext.tree.TreePanel in Ext 3.3.1. It looks like this: -root -fruit -apple -vegetable

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

-root
    -fruit
        -apple
    -vegetable
        -carrot

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.

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?

Thanks for your time.


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

See the Ext.Component documentation: http://docs.sencha.com/ext-js/3-4/#!/api/Ext.Component-method-cloneConfig

0

精彩评论

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