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;
27 onDragOut : function(e, id)
29 Roo.tree.TreeDragZone.superclass.prototype.onDragOut.call(this, e, id);
32 onInitDrag : function(e){
33 var data = this.dragData;
34 this.tree.getSelectionModel().select(data.node);
35 this.proxy.update("");
36 data.node.ui.appendDDGhost(this.proxy.ghost.dom);
37 this.tree.fireEvent("startdrag", this.tree, data.node, e);
40 getRepairXY : function(e, data){
41 return data.node.ui.getDDRepairXY();
44 onEndDrag : function(data, e){
45 this.tree.fireEvent("enddrag", this.tree, data.node, e);
48 onValidDrop : function(dd, e, id){
49 this.tree.fireEvent("dragdrop", this.tree, this.dragData.node, dd, e);
53 beforeInvalidDrop : function(e, id){
54 // this scrolls the original position back into view
55 var sm = this.tree.getSelectionModel();
57 sm.select(this.dragData.node);