-
20 Sep 2012 10:27 AM #1
Tree view DD, copy a subtree
Tree view DD, copy a subtree
Hi, i started working with the example of two-trees in the examples folder, trying to make the left tree "static" and copying its items to the right tree. Basically, i added the line copy: true in its viewConfig:
The problem arises when i drag a tree with 3 or more levels of depth. At level two, it renders the whole tree again up to the leaf.Code:viewConfig: { copy: true, plugins: { ptype: 'treeviewdragdrop', appendOnly: true } },
The complete code is this:
Thanks in advance.Code:Ext.require(['*']); Ext.onReady(function(){ var store = Ext.create('Ext.data.TreeStore', { proxy: { type: 'ajax', url: 'nodes.json' }, root: { text: 'Ext JS', id: 'src', expanded: true }, folderSort: true, sorters: [{ property: 'text', direction: 'ASC' }] }); var tree = Ext.create('Ext.tree.Panel', { id: 'tree', store: store, width: 250, height: 300, viewConfig: { copy: true, plugins: { ptype: 'treeviewdragdrop', appendOnly: true } }, renderTo: document.body }); var store2 = Ext.create('Ext.data.TreeStore', { proxy: { type: 'ajax', url: 'nodes.json' }, root: { text: 'Custom Ext JS', id: 'src', expanded: true, children: [] }, folderSort: true, sorters: [{ property: 'text', direction: 'ASC' }] }); var tree2 = Ext.create('Ext.tree.Panel', { id: 'tree2', width: 250, height: 300, store: store2, viewConfig: { plugins: { ptype: 'treeviewdragdrop', appendOnly: true, } }, renderTo: document.body }); });
-
21 Sep 2012 6:10 AM #2
Can I get you to post your JSON file so we are reviewing the same setup?
Thanks,
Scott.
-
21 Sep 2012 6:14 AM #3
Yes, this is the JSON file:
You can use the same file for the two stores.Code:[{ prd_code: '1', prd_name: 'Producto 1', text: 'Producto 1', iconCls: 'product', nodeType: 'product', deploy: false, children: [ { prd_code: '2', prd_name: 'Producto 2', text: 'Producto 2', iconCls: 'product', nodeType: 'product', deploy: false, children: [ { prd_code: '3', prd_name: 'Producto 3', text: 'Producto 3', iconCls: 'product', nodeType: 'product', deploy: false, children: [ { prd_code: '4', prd_name: 'Producto 4', text: 'Producto 4', iconCls: 'product', nodeType: 'product', deploy: false, children:[ { mdl_id: '1', mdl_name: 'Modulo 1', mdl_description: 'Descripcion Modulo 1', text: 'Modulo 1', iconCls: 'module', nodeType: 'module', deploy: false, leaf: true } ] }, { prd_code: '5', prd_name: 'Producto 5', text: 'Producto 5', iconCls: 'product', deploy: false, nodeType: 'product', children:[ { mdl_id: '2', mdl_name: 'Modulo 2', mdl_description: 'Descripcion Modulo 2', leaf: true, iconCls: 'module', nodeType: 'module', deploy: false, text: 'Modulo 2' } ] }, { prd_code: '6', prd_name: 'Producto 6', text: 'Producto 6', iconCls: 'product', deploy: false, nodeType: 'product', children: [ { mdl_id: '3', mdl_name: 'Modulo 3', mdl_description: 'Descripcion Modulo 3', leaf: true, iconCls: 'module', deploy: false, nodeType: 'module', text: 'Modulo 3' } ] } ] } ] }, { prd_code: '7', prd_name: 'Producto 7', text: 'Producto 7', iconCls: 'product', nodeType: 'product', deploy: false, children: [ { mdl_id: '4', mdl_name: 'Modulo 4', mdl_description: 'Descripcion Modulo 5', leaf: true, deploy: false, iconCls: 'module', nodeType: 'module', text: 'Modulo 4' } ] } ] }]
-
21 Sep 2012 6:30 AM #4
Thanks for the report! I have opened a bug in our bug tracker.
-
17 Apr 2013 2:44 AM #5
Could you please post an override for those who aren't subscribers

Success! Looks like we've fixed this one. According to our records the fix was applied for
EXTJSIV-7321
in
4.1.3 Sprint 1.


Reply With Quote