PDA

View Full Version : TreePanel - movenode + rawEvent



Zdeno
6 Apr 2010, 5:37 AM
Does anybody know how i can get rawEvent when movenode or beforemovenode is fired? I would like to get from rawEvent if ctrl-key was pressed or not.

I wanted fix bug in app when user draging and droping node to same tree and when he put node to same place ( he can see line above draged node ) move events are not fired.

I need to use movenode events because in drop events dont know old and newParent.

Thank you for tips

Zdeno
6 Apr 2010, 6:19 AM
Solved ...



var pressedCtrl = false;




listeners:{
beforenodedrop: function( e ) {
if ( e.rawEvent.ctrlKey )
pressedCtrl = true;
else
pressedCtrl = false;
}
,movenode: function( tree, node, oldParent, newParent, index ) {
console.log(pressedCtrl);
}
,nodedrop: function ( e ) {
pressedCtrl = false;
}
}