-
3 Apr 2012 3:12 AM #1
Adding of treenode from SlaveTree to MasterTree
Adding of treenode from SlaveTree to MasterTree
Hi all,
This is what I am trying to achieve in ExtJs 3.3.1:
I have SlaveTreePanel and MasterTreePanel. All the nodes (from treeloader) in SlaveTree can be appended to a node in MasterTree. And I want the nodes in SlaveTree to remain after appending to MasterTree.
This is the code for my listener in MasterTreePanel.
This is working fine until I dragged the same node from SlaveTree into MasterTree twice.Code:beforenodedrop: function (e){ e.dropNode = e.tree.getLoader().createNode(e.dropNode.attributes); }
I have changed the attributes of the first node in MasterTree. And when i dragged the
same node into MasterTree the 2nd time, it overwrites the attributes of the first node.
Is there anyway I can do it? Or did i make some mistake in the listener above?
Thanks in advance.
-
3 Apr 2012 9:16 PM #2
Hi, have anyone encountered this before? I cannot seem to find a solution to this. Thanks
-
4 Apr 2012 1:14 AM #3
I'm no expert with tree menus combined with drag&drop, but if it overwrites the values when you drop the same node onto the master tree a second time, this would logically make me think you must be carrying over the same ID twice (hence it updates the values of an existing node)?
When dropping a node onto the master tree, I would assume you should assign a new/unique ID each time.
As I said, I'm no expert with these elements/methods, but that is what I would immediately investigate if I ran into this problem...
-
4 Apr 2012 1:17 AM #4
Hi willigogs,
thks for the reply. U r right!
I thought i can change the node id simply by node.id = '123',
I guess node.setId('123') is the correct method.
Thanks again!


Reply With Quote