PDA

View Full Version : Ext.tree.TreePanel beforemovenode fires when it shouldn't



mdavis6890
5 Feb 2011, 7:09 PM
Ext version tested:

Ext 3.3.1


Adapter used:

ext


css used:

only default ext-all.css




Browser versions tested against:

FF3 (firebug 1.6 installed)


Operating System:

Windows 7


Description:

When moving a node from one tree to another, the beforemovenode event fires, when the docs say it shouldn't. beforemovenode should only fire when moving a node within a tree, not from one tree to another.


Test Case:



var a = new Ext.tree.TreePanel({
renderTo : Ext.getBody(),
enableDD : true,
width : 300,
height : 400,
columns : [{
header: 'TestCol',
dataIndex: 'text',
width : 100
}],
root : new Ext.tree.TreeNode({
text : 'root1',
id : 'root1',
expanded : true
}),
rootVisible: true,
listeners : {beforemovenode : function() {console.log('node moved')}}
});
a.getRootNode().appendChild(new Ext.tree.TreeNode({
text : 'test1',
id : 'test1',
leaf : true
}))
var b = new Ext.tree.TreePanel({
renderTo : Ext.getBody(),
enableDD : true,
width : 300,
height : 200,
columns : [{
header: 'TestCol',
dataIndex: 'text',
width : 100
}],
root : new Ext.tree.TreeNode({
text : 'root2',
id : 'root2',
expanded : true
}),
rootVisible: true
});
b.getRootNode().appendChild(new Ext.tree.TreeNode({
text : 'test2',
id : 'test2',
leaf : true
}))




Steps to reproduce the problem:

Create a couple of trees with DD enabled (See above sample)
Drag a node from one tree to the other.


The result that was expected:

beforemovenode doesn't fire.


The result that occurs instead:

beforemovenode does fire.


Screenshot or Video:

attached


Debugging already done:

None, but please tell me how I can improve in this area to help you more.


Possible fix:

None, but please tell me how I can improve in this area to help you more.