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