3 <title>The source code</title>
\r
4 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
\r
5 <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
\r
7 <body onload="prettyPrint();">
\r
8 <pre class="prettyprint lang-js"><div id="cls-Ext.tree.TreeDragZone"></div>/**
\r
9 * @class Ext.tree.TreeDragZone
\r
10 * @extends Ext.dd.DragZone
\r
12 * @param {String/HTMLElement/Element} tree The {@link Ext.tree.TreePanel} for which to enable dragging
\r
13 * @param {Object} config
\r
15 if(Ext.dd.DragZone){
\r
16 Ext.tree.TreeDragZone = function(tree, config){
\r
17 Ext.tree.TreeDragZone.superclass.constructor.call(this, tree.innerCt, config);
\r
18 <div id="prop-Ext.tree.TreeDragZone-tree"></div>/**
\r
19 * The TreePanel for this drag zone
\r
20 * @type Ext.tree.TreePanel
\r
26 Ext.extend(Ext.tree.TreeDragZone, Ext.dd.DragZone, {
\r
27 <div id="cfg-Ext.tree.TreeDragZone-ddGroup"></div>/**
\r
28 * @cfg {String} ddGroup
\r
29 * A named drag drop group to which this object belongs. If a group is specified, then this object will only
\r
30 * interact with other drag drop objects in the same group (defaults to 'TreeDD').
\r
35 onBeforeDrag : function(data, e){
\r
37 return n && n.draggable && !n.disabled;
\r
41 onInitDrag : function(e){
\r
42 var data = this.dragData;
\r
43 this.tree.getSelectionModel().select(data.node);
\r
44 this.tree.eventModel.disable();
\r
45 this.proxy.update("");
\r
46 data.node.ui.appendDDGhost(this.proxy.ghost.dom);
\r
47 this.tree.fireEvent("startdrag", this.tree, data.node, e);
\r
51 getRepairXY : function(e, data){
\r
52 return data.node.ui.getDDRepairXY();
\r
56 onEndDrag : function(data, e){
\r
57 this.tree.eventModel.enable.defer(100, this.tree.eventModel);
\r
58 this.tree.fireEvent("enddrag", this.tree, data.node, e);
\r
62 onValidDrop : function(dd, e, id){
\r
63 this.tree.fireEvent("dragdrop", this.tree, this.dragData.node, dd, e);
\r
68 beforeInvalidDrop : function(e, id){
\r
69 // this scrolls the original position back into view
\r
70 var sm = this.tree.getSelectionModel();
\r
71 sm.clearSelections();
\r
72 sm.select(this.dragData.node);
\r
76 afterRepair : function(){
\r
77 if (Ext.enableFx && this.tree.hlDrop) {
\r
78 Ext.Element.fly(this.dragData.ddel).highlight(this.hlColor || "c3daf9");
\r
80 this.dragging = false;
\r