4 * Copyright(c) 2006-2007, Ext JS, LLC.
6 * Originally Released Under LGPL - original licence link has changed is not relivant.
9 * <script type="text/javascript">
14 Roo.tree.TreeDragZone = function(tree, config){
15 Roo.tree.TreeDragZone.superclass.constructor.call(this, tree.getTreeEl(), config);
19 Roo.extend(Roo.tree.TreeDragZone, Roo.dd.DragZone, {
22 onBeforeDrag : function(data, e){
24 return n && n.draggable && !n.disabled;
28 onInitDrag : function(e){
29 var data = this.dragData;
30 this.tree.getSelectionModel().select(data.node);
31 this.proxy.update("");
32 data.node.ui.appendDDGhost(this.proxy.ghost.dom);
33 this.tree.fireEvent("startdrag", this.tree, data.node, e);
36 getRepairXY : function(e, data){
37 return data.node.ui.getDDRepairXY();
40 onEndDrag : function(data, e){
41 this.tree.fireEvent("enddrag", this.tree, data.node, e);
46 onValidDrop : function(dd, e, id){
47 this.tree.fireEvent("dragdrop", this.tree, this.dragData.node, dd, e);
51 beforeInvalidDrop : function(e, id){
52 // this scrolls the original position back into view
53 var sm = this.tree.getSelectionModel();
55 sm.select(this.dragData.node);