3 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
4 <title>The source code</title>
5 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
6 <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
8 <body onload="prettyPrint();">
9 <pre class="prettyprint lang-js">/*!
10 * Ext JS Library 3.2.1
11 * Copyright(c) 2006-2010 Ext JS, Inc.
13 * http://www.extjs.com/license
15 <div id="cls-Ext.tree.TreeDragZone"></div>/**
16 * @class Ext.tree.TreeDragZone
17 * @extends Ext.dd.DragZone
19 * @param {String/HTMLElement/Element} tree The {@link Ext.tree.TreePanel} for which to enable dragging
20 * @param {Object} config
23 Ext.tree.TreeDragZone = function(tree, config){
24 Ext.tree.TreeDragZone.superclass.constructor.call(this, tree.innerCt, config);
25 <div id="prop-Ext.tree.TreeDragZone-tree"></div>/**
26 * The TreePanel for this drag zone
27 * @type Ext.tree.TreePanel
33 Ext.extend(Ext.tree.TreeDragZone, Ext.dd.DragZone, {
34 <div id="cfg-Ext.tree.TreeDragZone-ddGroup"></div>/**
35 * @cfg {String} ddGroup
36 * A named drag drop group to which this object belongs. If a group is specified, then this object will only
37 * interact with other drag drop objects in the same group (defaults to 'TreeDD').
42 onBeforeDrag : function(data, e){
44 return n && n.draggable && !n.disabled;
48 onInitDrag : function(e){
49 var data = this.dragData;
50 this.tree.getSelectionModel().select(data.node);
51 this.tree.eventModel.disable();
52 this.proxy.update("");
53 data.node.ui.appendDDGhost(this.proxy.ghost.dom);
54 this.tree.fireEvent("startdrag", this.tree, data.node, e);
58 getRepairXY : function(e, data){
59 return data.node.ui.getDDRepairXY();
63 onEndDrag : function(data, e){
64 this.tree.eventModel.enable.defer(100, this.tree.eventModel);
65 this.tree.fireEvent("enddrag", this.tree, data.node, e);
69 onValidDrop : function(dd, e, id){
70 this.tree.fireEvent("dragdrop", this.tree, this.dragData.node, dd, e);
75 beforeInvalidDrop : function(e, id){
76 // this scrolls the original position back into view
77 var sm = this.tree.getSelectionModel();
79 sm.select(this.dragData.node);
83 afterRepair : function(){
84 if (Ext.enableFx && this.tree.hlDrop) {
85 Ext.Element.fly(this.dragData.ddel).highlight(this.hlColor || "c3daf9");
87 this.dragging = false;