Upgrade to ExtJS 3.1.0 - Released 12/16/2009
[extjs.git] / docs / source / DDCore.html
1 <html>\r
2 <head>\r
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
7 </head>\r
8 <body  onload="prettyPrint();">\r
9     <pre class="prettyprint lang-js">/*
10  * These classes are derivatives of the similarly named classes in the YUI Library.
11  * The original license:
12  * Copyright (c) 2006, Yahoo! Inc. All rights reserved.
13  * Code licensed under the BSD License:
14  * http://developer.yahoo.net/yui/license.txt
15  */
16
17 (function() {
18
19 var Event=Ext.EventManager;
20 var Dom=Ext.lib.Dom;
21
22 <div id="cls-Ext.dd.DragDrop"></div>/**
23  * @class Ext.dd.DragDrop
24  * Defines the interface and base operation of items that that can be
25  * dragged or can be drop targets.  It was designed to be extended, overriding
26  * the event handlers for startDrag, onDrag, onDragOver and onDragOut.
27  * Up to three html elements can be associated with a DragDrop instance:
28  * <ul>
29  * <li>linked element: the element that is passed into the constructor.
30  * This is the element which defines the boundaries for interaction with
31  * other DragDrop objects.</li>
32  * <li>handle element(s): The drag operation only occurs if the element that
33  * was clicked matches a handle element.  By default this is the linked
34  * element, but there are times that you will want only a portion of the
35  * linked element to initiate the drag operation, and the setHandleElId()
36  * method provides a way to define this.</li>
37  * <li>drag element: this represents the element that would be moved along
38  * with the cursor during a drag operation.  By default, this is the linked
39  * element itself as in {@link Ext.dd.DD}.  setDragElId() lets you define
40  * a separate element that would be moved, as in {@link Ext.dd.DDProxy}.
41  * </li>
42  * </ul>
43  * This class should not be instantiated until the onload event to ensure that
44  * the associated elements are available.
45  * The following would define a DragDrop obj that would interact with any
46  * other DragDrop obj in the "group1" group:
47  * <pre>
48  *  dd = new Ext.dd.DragDrop("div1", "group1");
49  * </pre>
50  * Since none of the event handlers have been implemented, nothing would
51  * actually happen if you were to run the code above.  Normally you would
52  * override this class or one of the default implementations, but you can
53  * also override the methods you want on an instance of the class...
54  * <pre>
55  *  dd.onDragDrop = function(e, id) {
56  *  &nbsp;&nbsp;alert("dd was dropped on " + id);
57  *  }
58  * </pre>
59  * @constructor
60  * @param {String} id of the element that is linked to this instance
61  * @param {String} sGroup the group of related DragDrop objects
62  * @param {object} config an object containing configurable attributes
63  *                Valid properties for DragDrop:
64  *                    padding, isTarget, maintainOffset, primaryButtonOnly
65  */
66 Ext.dd.DragDrop = function(id, sGroup, config) {
67     if(id) {
68         this.init(id, sGroup, config);
69     }
70 };
71
72 Ext.dd.DragDrop.prototype = {
73
74     <div id="prop-Ext.dd.DragDrop-ignoreSelf"></div>/**
75      * Set to false to enable a DragDrop object to fire drag events while dragging
76      * over its own Element. Defaults to true - DragDrop objects do not by default
77      * fire drag events to themselves.
78      * @property ignoreSelf
79      * @type Boolean
80      */
81
82     <div id="prop-Ext.dd.DragDrop-id"></div>/**
83      * The id of the element associated with this object.  This is what we
84      * refer to as the "linked element" because the size and position of
85      * this element is used to determine when the drag and drop objects have
86      * interacted.
87      * @property id
88      * @type String
89      */
90     id: null,
91
92     <div id="prop-Ext.dd.DragDrop-config"></div>/**
93      * Configuration attributes passed into the constructor
94      * @property config
95      * @type object
96      */
97     config: null,
98
99     /**
100      * The id of the element that will be dragged.  By default this is same
101      * as the linked element , but could be changed to another element. Ex:
102      * Ext.dd.DDProxy
103      * @property dragElId
104      * @type String
105      * @private
106      */
107     dragElId: null,
108
109     /**
110      * The ID of the element that initiates the drag operation.  By default
111      * this is the linked element, but could be changed to be a child of this
112      * element.  This lets us do things like only starting the drag when the
113      * header element within the linked html element is clicked.
114      * @property handleElId
115      * @type String
116      * @private
117      */
118     handleElId: null,
119
120     <div id="prop-Ext.dd.DragDrop-invalidHandleTypes"></div>/**
121      * An object who's property names identify HTML tags to be considered invalid as drag handles.
122      * A non-null property value identifies the tag as invalid. Defaults to the 
123      * following value which prevents drag operations from being initiated by &lt;a> elements:<pre><code>
124 {
125     A: "A"
126 }</code></pre>
127      * @property invalidHandleTypes
128      * @type Object
129      */
130     invalidHandleTypes: null,
131
132     <div id="prop-Ext.dd.DragDrop-invalidHandleIds"></div>/**
133      * An object who's property names identify the IDs of elements to be considered invalid as drag handles.
134      * A non-null property value identifies the ID as invalid. For example, to prevent
135      * dragging from being initiated on element ID "foo", use:<pre><code>
136 {
137     foo: true
138 }</code></pre>
139      * @property invalidHandleIds
140      * @type Object
141      */
142     invalidHandleIds: null,
143
144     <div id="prop-Ext.dd.DragDrop-invalidHandleClasses"></div>/**
145      * An Array of CSS class names for elements to be considered in valid as drag handles.
146      * @property invalidHandleClasses
147      * @type Array
148      */
149     invalidHandleClasses: null,
150
151     /**
152      * The linked element's absolute X position at the time the drag was
153      * started
154      * @property startPageX
155      * @type int
156      * @private
157      */
158     startPageX: 0,
159
160     /**
161      * The linked element's absolute X position at the time the drag was
162      * started
163      * @property startPageY
164      * @type int
165      * @private
166      */
167     startPageY: 0,
168
169     <div id="prop-Ext.dd.DragDrop-groups"></div>/**
170      * The group defines a logical collection of DragDrop objects that are
171      * related.  Instances only get events when interacting with other
172      * DragDrop object in the same group.  This lets us define multiple
173      * groups using a single DragDrop subclass if we want.
174      * @property groups
175      * @type object An object in the format {'group1':true, 'group2':true}
176      */
177     groups: null,
178
179     /**
180      * Individual drag/drop instances can be locked.  This will prevent
181      * onmousedown start drag.
182      * @property locked
183      * @type boolean
184      * @private
185      */
186     locked: false,
187
188     <div id="method-Ext.dd.DragDrop-lock"></div>/**
189      * Lock this instance
190      * @method lock
191      */
192     lock: function() { this.locked = true; },
193
194     <div id="prop-Ext.dd.DragDrop-moveOnly"></div>/**
195      * When set to true, other DD objects in cooperating DDGroups do not receive
196      * notification events when this DD object is dragged over them. Defaults to false.
197      * @property moveOnly
198      * @type boolean
199      */
200     moveOnly: false,
201
202     <div id="method-Ext.dd.DragDrop-unlock"></div>/**
203      * Unlock this instace
204      * @method unlock
205      */
206     unlock: function() { this.locked = false; },
207
208     <div id="prop-Ext.dd.DragDrop-isTarget"></div>/**
209      * By default, all instances can be a drop target.  This can be disabled by
210      * setting isTarget to false.
211      * @property isTarget
212      * @type boolean
213      */
214     isTarget: true,
215
216     <div id="prop-Ext.dd.DragDrop-padding"></div>/**
217      * The padding configured for this drag and drop object for calculating
218      * the drop zone intersection with this object.
219      * @property padding
220      * @type int[] An array containing the 4 padding values: [top, right, bottom, left]
221      */
222     padding: null,
223
224     /**
225      * Cached reference to the linked element
226      * @property _domRef
227      * @private
228      */
229     _domRef: null,
230
231     /**
232      * Internal typeof flag
233      * @property __ygDragDrop
234      * @private
235      */
236     __ygDragDrop: true,
237
238     /**
239      * Set to true when horizontal contraints are applied
240      * @property constrainX
241      * @type boolean
242      * @private
243      */
244     constrainX: false,
245
246     /**
247      * Set to true when vertical contraints are applied
248      * @property constrainY
249      * @type boolean
250      * @private
251      */
252     constrainY: false,
253
254     /**
255      * The left constraint
256      * @property minX
257      * @type int
258      * @private
259      */
260     minX: 0,
261
262     /**
263      * The right constraint
264      * @property maxX
265      * @type int
266      * @private
267      */
268     maxX: 0,
269
270     /**
271      * The up constraint
272      * @property minY
273      * @type int
274      * @type int
275      * @private
276      */
277     minY: 0,
278
279     /**
280      * The down constraint
281      * @property maxY
282      * @type int
283      * @private
284      */
285     maxY: 0,
286
287     <div id="prop-Ext.dd.DragDrop-maintainOffset"></div>/**
288      * Maintain offsets when we resetconstraints.  Set to true when you want
289      * the position of the element relative to its parent to stay the same
290      * when the page changes
291      *
292      * @property maintainOffset
293      * @type boolean
294      */
295     maintainOffset: false,
296
297     <div id="prop-Ext.dd.DragDrop-xTicks"></div>/**
298      * Array of pixel locations the element will snap to if we specified a
299      * horizontal graduation/interval.  This array is generated automatically
300      * when you define a tick interval.
301      * @property xTicks
302      * @type int[]
303      */
304     xTicks: null,
305
306     <div id="prop-Ext.dd.DragDrop-yTicks"></div>/**
307      * Array of pixel locations the element will snap to if we specified a
308      * vertical graduation/interval.  This array is generated automatically
309      * when you define a tick interval.
310      * @property yTicks
311      * @type int[]
312      */
313     yTicks: null,
314
315     <div id="prop-Ext.dd.DragDrop-primaryButtonOnly"></div>/**
316      * By default the drag and drop instance will only respond to the primary
317      * button click (left button for a right-handed mouse).  Set to true to
318      * allow drag and drop to start with any mouse click that is propogated
319      * by the browser
320      * @property primaryButtonOnly
321      * @type boolean
322      */
323     primaryButtonOnly: true,
324
325     <div id="prop-Ext.dd.DragDrop-available"></div>/**
326      * The availabe property is false until the linked dom element is accessible.
327      * @property available
328      * @type boolean
329      */
330     available: false,
331
332     <div id="prop-Ext.dd.DragDrop-hasOuterHandles"></div>/**
333      * By default, drags can only be initiated if the mousedown occurs in the
334      * region the linked element is.  This is done in part to work around a
335      * bug in some browsers that mis-report the mousedown if the previous
336      * mouseup happened outside of the window.  This property is set to true
337      * if outer handles are defined.
338      *
339      * @property hasOuterHandles
340      * @type boolean
341      * @default false
342      */
343     hasOuterHandles: false,
344
345     /**
346      * Code that executes immediately before the startDrag event
347      * @method b4StartDrag
348      * @private
349      */
350     b4StartDrag: function(x, y) { },
351
352     <div id="method-Ext.dd.DragDrop-startDrag"></div>/**
353      * Abstract method called after a drag/drop object is clicked
354      * and the drag or mousedown time thresholds have beeen met.
355      * @method startDrag
356      * @param {int} X click location
357      * @param {int} Y click location
358      */
359     startDrag: function(x, y) { /* override this */ },
360
361     /**
362      * Code that executes immediately before the onDrag event
363      * @method b4Drag
364      * @private
365      */
366     b4Drag: function(e) { },
367
368     <div id="method-Ext.dd.DragDrop-onDrag"></div>/**
369      * Abstract method called during the onMouseMove event while dragging an
370      * object.
371      * @method onDrag
372      * @param {Event} e the mousemove event
373      */
374     onDrag: function(e) { /* override this */ },
375
376     <div id="method-Ext.dd.DragDrop-onDragEnter"></div>/**
377      * Abstract method called when this element fist begins hovering over
378      * another DragDrop obj
379      * @method onDragEnter
380      * @param {Event} e the mousemove event
381      * @param {String|DragDrop[]} id In POINT mode, the element
382      * id this is hovering over.  In INTERSECT mode, an array of one or more
383      * dragdrop items being hovered over.
384      */
385     onDragEnter: function(e, id) { /* override this */ },
386
387     /**
388      * Code that executes immediately before the onDragOver event
389      * @method b4DragOver
390      * @private
391      */
392     b4DragOver: function(e) { },
393
394     <div id="method-Ext.dd.DragDrop-onDragOver"></div>/**
395      * Abstract method called when this element is hovering over another
396      * DragDrop obj
397      * @method onDragOver
398      * @param {Event} e the mousemove event
399      * @param {String|DragDrop[]} id In POINT mode, the element
400      * id this is hovering over.  In INTERSECT mode, an array of dd items
401      * being hovered over.
402      */
403     onDragOver: function(e, id) { /* override this */ },
404
405     /**
406      * Code that executes immediately before the onDragOut event
407      * @method b4DragOut
408      * @private
409      */
410     b4DragOut: function(e) { },
411
412     <div id="method-Ext.dd.DragDrop-onDragOut"></div>/**
413      * Abstract method called when we are no longer hovering over an element
414      * @method onDragOut
415      * @param {Event} e the mousemove event
416      * @param {String|DragDrop[]} id In POINT mode, the element
417      * id this was hovering over.  In INTERSECT mode, an array of dd items
418      * that the mouse is no longer over.
419      */
420     onDragOut: function(e, id) { /* override this */ },
421
422     /**
423      * Code that executes immediately before the onDragDrop event
424      * @method b4DragDrop
425      * @private
426      */
427     b4DragDrop: function(e) { },
428
429     <div id="method-Ext.dd.DragDrop-onDragDrop"></div>/**
430      * Abstract method called when this item is dropped on another DragDrop
431      * obj
432      * @method onDragDrop
433      * @param {Event} e the mouseup event
434      * @param {String|DragDrop[]} id In POINT mode, the element
435      * id this was dropped on.  In INTERSECT mode, an array of dd items this
436      * was dropped on.
437      */
438     onDragDrop: function(e, id) { /* override this */ },
439
440     <div id="method-Ext.dd.DragDrop-onInvalidDrop"></div>/**
441      * Abstract method called when this item is dropped on an area with no
442      * drop target
443      * @method onInvalidDrop
444      * @param {Event} e the mouseup event
445      */
446     onInvalidDrop: function(e) { /* override this */ },
447
448     /**
449      * Code that executes immediately before the endDrag event
450      * @method b4EndDrag
451      * @private
452      */
453     b4EndDrag: function(e) { },
454
455     <div id="method-Ext.dd.DragDrop-endDrag"></div>/**
456      * Fired when we are done dragging the object
457      * @method endDrag
458      * @param {Event} e the mouseup event
459      */
460     endDrag: function(e) { /* override this */ },
461
462     /**
463      * Code executed immediately before the onMouseDown event
464      * @method b4MouseDown
465      * @param {Event} e the mousedown event
466      * @private
467      */
468     b4MouseDown: function(e) {  },
469
470     <div id="method-Ext.dd.DragDrop-onMouseDown"></div>/**
471      * Event handler that fires when a drag/drop obj gets a mousedown
472      * @method onMouseDown
473      * @param {Event} e the mousedown event
474      */
475     onMouseDown: function(e) { /* override this */ },
476
477     <div id="method-Ext.dd.DragDrop-onMouseUp"></div>/**
478      * Event handler that fires when a drag/drop obj gets a mouseup
479      * @method onMouseUp
480      * @param {Event} e the mouseup event
481      */
482     onMouseUp: function(e) { /* override this */ },
483
484     <div id="method-Ext.dd.DragDrop-onAvailable"></div>/**
485      * Override the onAvailable method to do what is needed after the initial
486      * position was determined.
487      * @method onAvailable
488      */
489     onAvailable: function () {
490     },
491
492     <div id="prop-Ext.dd.DragDrop-defaultPadding"></div>/**
493      * Provides default constraint padding to "constrainTo" elements (defaults to {left: 0, right:0, top:0, bottom:0}).
494      * @type Object
495      */
496     defaultPadding : {left:0, right:0, top:0, bottom:0},
497
498     <div id="method-Ext.dd.DragDrop-constrainTo"></div>/**
499      * Initializes the drag drop object's constraints to restrict movement to a certain element.
500  *
501  * Usage:
502  <pre><code>
503  var dd = new Ext.dd.DDProxy("dragDiv1", "proxytest",
504                 { dragElId: "existingProxyDiv" });
505  dd.startDrag = function(){
506      this.constrainTo("parent-id");
507  };
508  </code></pre>
509  * Or you can initalize it using the {@link Ext.Element} object:
510  <pre><code>
511  Ext.get("dragDiv1").initDDProxy("proxytest", {dragElId: "existingProxyDiv"}, {
512      startDrag : function(){
513          this.constrainTo("parent-id");
514      }
515  });
516  </code></pre>
517      * @param {Mixed} constrainTo The element to constrain to.
518      * @param {Object/Number} pad (optional) Pad provides a way to specify "padding" of the constraints,
519      * and can be either a number for symmetrical padding (4 would be equal to {left:4, right:4, top:4, bottom:4}) or
520      * an object containing the sides to pad. For example: {right:10, bottom:10}
521      * @param {Boolean} inContent (optional) Constrain the draggable in the content box of the element (inside padding and borders)
522      */
523     constrainTo : function(constrainTo, pad, inContent){
524         if(Ext.isNumber(pad)){
525             pad = {left: pad, right:pad, top:pad, bottom:pad};
526         }
527         pad = pad || this.defaultPadding;
528         var b = Ext.get(this.getEl()).getBox(),
529             ce = Ext.get(constrainTo),
530             s = ce.getScroll(),
531             c, 
532             cd = ce.dom;
533         if(cd == document.body){
534             c = { x: s.left, y: s.top, width: Ext.lib.Dom.getViewWidth(), height: Ext.lib.Dom.getViewHeight()};
535         }else{
536             var xy = ce.getXY();
537             c = {x : xy[0], y: xy[1], width: cd.clientWidth, height: cd.clientHeight};
538         }
539
540
541         var topSpace = b.y - c.y,
542             leftSpace = b.x - c.x;
543
544         this.resetConstraints();
545         this.setXConstraint(leftSpace - (pad.left||0), // left
546                 c.width - leftSpace - b.width - (pad.right||0), //right
547                                 this.xTickSize
548         );
549         this.setYConstraint(topSpace - (pad.top||0), //top
550                 c.height - topSpace - b.height - (pad.bottom||0), //bottom
551                                 this.yTickSize
552         );
553     },
554
555     <div id="method-Ext.dd.DragDrop-getEl"></div>/**
556      * Returns a reference to the linked element
557      * @method getEl
558      * @return {HTMLElement} the html element
559      */
560     getEl: function() {
561         if (!this._domRef) {
562             this._domRef = Ext.getDom(this.id);
563         }
564
565         return this._domRef;
566     },
567
568     <div id="method-Ext.dd.DragDrop-getDragEl"></div>/**
569      * Returns a reference to the actual element to drag.  By default this is
570      * the same as the html element, but it can be assigned to another
571      * element. An example of this can be found in Ext.dd.DDProxy
572      * @method getDragEl
573      * @return {HTMLElement} the html element
574      */
575     getDragEl: function() {
576         return Ext.getDom(this.dragElId);
577     },
578
579     <div id="method-Ext.dd.DragDrop-init"></div>/**
580      * Sets up the DragDrop object.  Must be called in the constructor of any
581      * Ext.dd.DragDrop subclass
582      * @method init
583      * @param id the id of the linked element
584      * @param {String} sGroup the group of related items
585      * @param {object} config configuration attributes
586      */
587     init: function(id, sGroup, config) {
588         this.initTarget(id, sGroup, config);
589         Event.on(this.id, "mousedown", this.handleMouseDown, this);
590         // Event.on(this.id, "selectstart", Event.preventDefault);
591     },
592
593     <div id="method-Ext.dd.DragDrop-initTarget"></div>/**
594      * Initializes Targeting functionality only... the object does not
595      * get a mousedown handler.
596      * @method initTarget
597      * @param id the id of the linked element
598      * @param {String} sGroup the group of related items
599      * @param {object} config configuration attributes
600      */
601     initTarget: function(id, sGroup, config) {
602
603         // configuration attributes
604         this.config = config || {};
605
606         // create a local reference to the drag and drop manager
607         this.DDM = Ext.dd.DDM;
608         // initialize the groups array
609         this.groups = {};
610
611         // assume that we have an element reference instead of an id if the
612         // parameter is not a string
613         if (typeof id !== "string") {
614             id = Ext.id(id);
615         }
616
617         // set the id
618         this.id = id;
619
620         // add to an interaction group
621         this.addToGroup((sGroup) ? sGroup : "default");
622
623         // We don't want to register this as the handle with the manager
624         // so we just set the id rather than calling the setter.
625         this.handleElId = id;
626
627         // the linked element is the element that gets dragged by default
628         this.setDragElId(id);
629
630         // by default, clicked anchors will not start drag operations.
631         this.invalidHandleTypes = { A: "A" };
632         this.invalidHandleIds = {};
633         this.invalidHandleClasses = [];
634
635         this.applyConfig();
636
637         this.handleOnAvailable();
638     },
639
640     <div id="method-Ext.dd.DragDrop-applyConfig"></div>/**
641      * Applies the configuration parameters that were passed into the constructor.
642      * This is supposed to happen at each level through the inheritance chain.  So
643      * a DDProxy implentation will execute apply config on DDProxy, DD, and
644      * DragDrop in order to get all of the parameters that are available in
645      * each object.
646      * @method applyConfig
647      */
648     applyConfig: function() {
649
650         // configurable properties:
651         //    padding, isTarget, maintainOffset, primaryButtonOnly
652         this.padding           = this.config.padding || [0, 0, 0, 0];
653         this.isTarget          = (this.config.isTarget !== false);
654         this.maintainOffset    = (this.config.maintainOffset);
655         this.primaryButtonOnly = (this.config.primaryButtonOnly !== false);
656
657     },
658
659     /**
660      * Executed when the linked element is available
661      * @method handleOnAvailable
662      * @private
663      */
664     handleOnAvailable: function() {
665         this.available = true;
666         this.resetConstraints();
667         this.onAvailable();
668     },
669
670      <div id="method-Ext.dd.DragDrop-setPadding"></div>/**
671      * Configures the padding for the target zone in px.  Effectively expands
672      * (or reduces) the virtual object size for targeting calculations.
673      * Supports css-style shorthand; if only one parameter is passed, all sides
674      * will have that padding, and if only two are passed, the top and bottom
675      * will have the first param, the left and right the second.
676      * @method setPadding
677      * @param {int} iTop    Top pad
678      * @param {int} iRight  Right pad
679      * @param {int} iBot    Bot pad
680      * @param {int} iLeft   Left pad
681      */
682     setPadding: function(iTop, iRight, iBot, iLeft) {
683         // this.padding = [iLeft, iRight, iTop, iBot];
684         if (!iRight && 0 !== iRight) {
685             this.padding = [iTop, iTop, iTop, iTop];
686         } else if (!iBot && 0 !== iBot) {
687             this.padding = [iTop, iRight, iTop, iRight];
688         } else {
689             this.padding = [iTop, iRight, iBot, iLeft];
690         }
691     },
692
693     <div id="method-Ext.dd.DragDrop-setInitPosition"></div>/**
694      * Stores the initial placement of the linked element.
695      * @method setInitPosition
696      * @param {int} diffX   the X offset, default 0
697      * @param {int} diffY   the Y offset, default 0
698      */
699     setInitPosition: function(diffX, diffY) {
700         var el = this.getEl();
701
702         if (!this.DDM.verifyEl(el)) {
703             return;
704         }
705
706         var dx = diffX || 0;
707         var dy = diffY || 0;
708
709         var p = Dom.getXY( el );
710
711         this.initPageX = p[0] - dx;
712         this.initPageY = p[1] - dy;
713
714         this.lastPageX = p[0];
715         this.lastPageY = p[1];
716
717
718         this.setStartPosition(p);
719     },
720
721     /**
722      * Sets the start position of the element.  This is set when the obj
723      * is initialized, the reset when a drag is started.
724      * @method setStartPosition
725      * @param pos current position (from previous lookup)
726      * @private
727      */
728     setStartPosition: function(pos) {
729         var p = pos || Dom.getXY( this.getEl() );
730         this.deltaSetXY = null;
731
732         this.startPageX = p[0];
733         this.startPageY = p[1];
734     },
735
736     <div id="method-Ext.dd.DragDrop-addToGroup"></div>/**
737      * Add this instance to a group of related drag/drop objects.  All
738      * instances belong to at least one group, and can belong to as many
739      * groups as needed.
740      * @method addToGroup
741      * @param sGroup {string} the name of the group
742      */
743     addToGroup: function(sGroup) {
744         this.groups[sGroup] = true;
745         this.DDM.regDragDrop(this, sGroup);
746     },
747
748     <div id="method-Ext.dd.DragDrop-removeFromGroup"></div>/**
749      * Remove's this instance from the supplied interaction group
750      * @method removeFromGroup
751      * @param {string}  sGroup  The group to drop
752      */
753     removeFromGroup: function(sGroup) {
754         if (this.groups[sGroup]) {
755             delete this.groups[sGroup];
756         }
757
758         this.DDM.removeDDFromGroup(this, sGroup);
759     },
760
761     <div id="method-Ext.dd.DragDrop-setDragElId"></div>/**
762      * Allows you to specify that an element other than the linked element
763      * will be moved with the cursor during a drag
764      * @method setDragElId
765      * @param id {string} the id of the element that will be used to initiate the drag
766      */
767     setDragElId: function(id) {
768         this.dragElId = id;
769     },
770
771     <div id="method-Ext.dd.DragDrop-setHandleElId"></div>/**
772      * Allows you to specify a child of the linked element that should be
773      * used to initiate the drag operation.  An example of this would be if
774      * you have a content div with text and links.  Clicking anywhere in the
775      * content area would normally start the drag operation.  Use this method
776      * to specify that an element inside of the content div is the element
777      * that starts the drag operation.
778      * @method setHandleElId
779      * @param id {string} the id of the element that will be used to
780      * initiate the drag.
781      */
782     setHandleElId: function(id) {
783         if (typeof id !== "string") {
784             id = Ext.id(id);
785         }
786         this.handleElId = id;
787         this.DDM.regHandle(this.id, id);
788     },
789
790     <div id="method-Ext.dd.DragDrop-setOuterHandleElId"></div>/**
791      * Allows you to set an element outside of the linked element as a drag
792      * handle
793      * @method setOuterHandleElId
794      * @param id the id of the element that will be used to initiate the drag
795      */
796     setOuterHandleElId: function(id) {
797         if (typeof id !== "string") {
798             id = Ext.id(id);
799         }
800         Event.on(id, "mousedown",
801                 this.handleMouseDown, this);
802         this.setHandleElId(id);
803
804         this.hasOuterHandles = true;
805     },
806
807     <div id="method-Ext.dd.DragDrop-unreg"></div>/**
808      * Remove all drag and drop hooks for this element
809      * @method unreg
810      */
811     unreg: function() {
812         Event.un(this.id, "mousedown",
813                 this.handleMouseDown);
814         this._domRef = null;
815         this.DDM._remove(this);
816     },
817
818     destroy : function(){
819         this.unreg();
820     },
821
822     <div id="method-Ext.dd.DragDrop-isLocked"></div>/**
823      * Returns true if this instance is locked, or the drag drop mgr is locked
824      * (meaning that all drag/drop is disabled on the page.)
825      * @method isLocked
826      * @return {boolean} true if this obj or all drag/drop is locked, else
827      * false
828      */
829     isLocked: function() {
830         return (this.DDM.isLocked() || this.locked);
831     },
832
833     /**
834      * Fired when this object is clicked
835      * @method handleMouseDown
836      * @param {Event} e
837      * @param {Ext.dd.DragDrop} oDD the clicked dd object (this dd obj)
838      * @private
839      */
840     handleMouseDown: function(e, oDD){
841         if (this.primaryButtonOnly && e.button != 0) {
842             return;
843         }
844
845         if (this.isLocked()) {
846             return;
847         }
848
849         this.DDM.refreshCache(this.groups);
850
851         var pt = new Ext.lib.Point(Ext.lib.Event.getPageX(e), Ext.lib.Event.getPageY(e));
852         if (!this.hasOuterHandles && !this.DDM.isOverTarget(pt, this) )  {
853         } else {
854             if (this.clickValidator(e)) {
855
856                 // set the initial element position
857                 this.setStartPosition();
858
859
860                 this.b4MouseDown(e);
861                 this.onMouseDown(e);
862
863                 this.DDM.handleMouseDown(e, this);
864
865                 this.DDM.stopEvent(e);
866             } else {
867
868
869             }
870         }
871     },
872
873     clickValidator: function(e) {
874         var target = e.getTarget();
875         return ( this.isValidHandleChild(target) &&
876                     (this.id == this.handleElId ||
877                         this.DDM.handleWasClicked(target, this.id)) );
878     },
879
880     <div id="method-Ext.dd.DragDrop-addInvalidHandleType"></div>/**
881      * Allows you to specify a tag name that should not start a drag operation
882      * when clicked.  This is designed to facilitate embedding links within a
883      * drag handle that do something other than start the drag.
884      * @method addInvalidHandleType
885      * @param {string} tagName the type of element to exclude
886      */
887     addInvalidHandleType: function(tagName) {
888         var type = tagName.toUpperCase();
889         this.invalidHandleTypes[type] = type;
890     },
891
892     <div id="method-Ext.dd.DragDrop-addInvalidHandleId"></div>/**
893      * Lets you to specify an element id for a child of a drag handle
894      * that should not initiate a drag
895      * @method addInvalidHandleId
896      * @param {string} id the element id of the element you wish to ignore
897      */
898     addInvalidHandleId: function(id) {
899         if (typeof id !== "string") {
900             id = Ext.id(id);
901         }
902         this.invalidHandleIds[id] = id;
903     },
904
905     <div id="method-Ext.dd.DragDrop-addInvalidHandleClass"></div>/**
906      * Lets you specify a css class of elements that will not initiate a drag
907      * @method addInvalidHandleClass
908      * @param {string} cssClass the class of the elements you wish to ignore
909      */
910     addInvalidHandleClass: function(cssClass) {
911         this.invalidHandleClasses.push(cssClass);
912     },
913
914     <div id="method-Ext.dd.DragDrop-removeInvalidHandleType"></div>/**
915      * Unsets an excluded tag name set by addInvalidHandleType
916      * @method removeInvalidHandleType
917      * @param {string} tagName the type of element to unexclude
918      */
919     removeInvalidHandleType: function(tagName) {
920         var type = tagName.toUpperCase();
921         // this.invalidHandleTypes[type] = null;
922         delete this.invalidHandleTypes[type];
923     },
924
925     <div id="method-Ext.dd.DragDrop-removeInvalidHandleId"></div>/**
926      * Unsets an invalid handle id
927      * @method removeInvalidHandleId
928      * @param {string} id the id of the element to re-enable
929      */
930     removeInvalidHandleId: function(id) {
931         if (typeof id !== "string") {
932             id = Ext.id(id);
933         }
934         delete this.invalidHandleIds[id];
935     },
936
937     <div id="method-Ext.dd.DragDrop-removeInvalidHandleClass"></div>/**
938      * Unsets an invalid css class
939      * @method removeInvalidHandleClass
940      * @param {string} cssClass the class of the element(s) you wish to
941      * re-enable
942      */
943     removeInvalidHandleClass: function(cssClass) {
944         for (var i=0, len=this.invalidHandleClasses.length; i<len; ++i) {
945             if (this.invalidHandleClasses[i] == cssClass) {
946                 delete this.invalidHandleClasses[i];
947             }
948         }
949     },
950
951     <div id="method-Ext.dd.DragDrop-isValidHandleChild"></div>/**
952      * Checks the tag exclusion list to see if this click should be ignored
953      * @method isValidHandleChild
954      * @param {HTMLElement} node the HTMLElement to evaluate
955      * @return {boolean} true if this is a valid tag type, false if not
956      */
957     isValidHandleChild: function(node) {
958
959         var valid = true;
960         // var n = (node.nodeName == "#text") ? node.parentNode : node;
961         var nodeName;
962         try {
963             nodeName = node.nodeName.toUpperCase();
964         } catch(e) {
965             nodeName = node.nodeName;
966         }
967         valid = valid && !this.invalidHandleTypes[nodeName];
968         valid = valid && !this.invalidHandleIds[node.id];
969
970         for (var i=0, len=this.invalidHandleClasses.length; valid && i<len; ++i) {
971             valid = !Ext.fly(node).hasClass(this.invalidHandleClasses[i]);
972         }
973
974
975         return valid;
976
977     },
978
979     /**
980      * Create the array of horizontal tick marks if an interval was specified
981      * in setXConstraint().
982      * @method setXTicks
983      * @private
984      */
985     setXTicks: function(iStartX, iTickSize) {
986         this.xTicks = [];
987         this.xTickSize = iTickSize;
988
989         var tickMap = {};
990
991         for (var i = this.initPageX; i >= this.minX; i = i - iTickSize) {
992             if (!tickMap[i]) {
993                 this.xTicks[this.xTicks.length] = i;
994                 tickMap[i] = true;
995             }
996         }
997
998         for (i = this.initPageX; i <= this.maxX; i = i + iTickSize) {
999             if (!tickMap[i]) {
1000                 this.xTicks[this.xTicks.length] = i;
1001                 tickMap[i] = true;
1002             }
1003         }
1004
1005         this.xTicks.sort(this.DDM.numericSort) ;
1006     },
1007
1008     /**
1009      * Create the array of vertical tick marks if an interval was specified in
1010      * setYConstraint().
1011      * @method setYTicks
1012      * @private
1013      */
1014     setYTicks: function(iStartY, iTickSize) {
1015         this.yTicks = [];
1016         this.yTickSize = iTickSize;
1017
1018         var tickMap = {};
1019
1020         for (var i = this.initPageY; i >= this.minY; i = i - iTickSize) {
1021             if (!tickMap[i]) {
1022                 this.yTicks[this.yTicks.length] = i;
1023                 tickMap[i] = true;
1024             }
1025         }
1026
1027         for (i = this.initPageY; i <= this.maxY; i = i + iTickSize) {
1028             if (!tickMap[i]) {
1029                 this.yTicks[this.yTicks.length] = i;
1030                 tickMap[i] = true;
1031             }
1032         }
1033
1034         this.yTicks.sort(this.DDM.numericSort) ;
1035     },
1036
1037     <div id="method-Ext.dd.DragDrop-setXConstraint"></div>/**
1038      * By default, the element can be dragged any place on the screen.  Use
1039      * this method to limit the horizontal travel of the element.  Pass in
1040      * 0,0 for the parameters if you want to lock the drag to the y axis.
1041      * @method setXConstraint
1042      * @param {int} iLeft the number of pixels the element can move to the left
1043      * @param {int} iRight the number of pixels the element can move to the
1044      * right
1045      * @param {int} iTickSize optional parameter for specifying that the
1046      * element
1047      * should move iTickSize pixels at a time.
1048      */
1049     setXConstraint: function(iLeft, iRight, iTickSize) {
1050         this.leftConstraint = iLeft;
1051         this.rightConstraint = iRight;
1052
1053         this.minX = this.initPageX - iLeft;
1054         this.maxX = this.initPageX + iRight;
1055         if (iTickSize) { this.setXTicks(this.initPageX, iTickSize); }
1056
1057         this.constrainX = true;
1058     },
1059
1060     <div id="method-Ext.dd.DragDrop-clearConstraints"></div>/**
1061      * Clears any constraints applied to this instance.  Also clears ticks
1062      * since they can't exist independent of a constraint at this time.
1063      * @method clearConstraints
1064      */
1065     clearConstraints: function() {
1066         this.constrainX = false;
1067         this.constrainY = false;
1068         this.clearTicks();
1069     },
1070
1071     <div id="method-Ext.dd.DragDrop-clearTicks"></div>/**
1072      * Clears any tick interval defined for this instance
1073      * @method clearTicks
1074      */
1075     clearTicks: function() {
1076         this.xTicks = null;
1077         this.yTicks = null;
1078         this.xTickSize = 0;
1079         this.yTickSize = 0;
1080     },
1081
1082     <div id="method-Ext.dd.DragDrop-setYConstraint"></div>/**
1083      * By default, the element can be dragged any place on the screen.  Set
1084      * this to limit the vertical travel of the element.  Pass in 0,0 for the
1085      * parameters if you want to lock the drag to the x axis.
1086      * @method setYConstraint
1087      * @param {int} iUp the number of pixels the element can move up
1088      * @param {int} iDown the number of pixels the element can move down
1089      * @param {int} iTickSize optional parameter for specifying that the
1090      * element should move iTickSize pixels at a time.
1091      */
1092     setYConstraint: function(iUp, iDown, iTickSize) {
1093         this.topConstraint = iUp;
1094         this.bottomConstraint = iDown;
1095
1096         this.minY = this.initPageY - iUp;
1097         this.maxY = this.initPageY + iDown;
1098         if (iTickSize) { this.setYTicks(this.initPageY, iTickSize); }
1099
1100         this.constrainY = true;
1101
1102     },
1103
1104     <div id="method-Ext.dd.DragDrop-resetConstraints"></div>/**
1105      * resetConstraints must be called if you manually reposition a dd element.
1106      * @method resetConstraints
1107      * @param {boolean} maintainOffset
1108      */
1109     resetConstraints: function() {
1110
1111
1112         // Maintain offsets if necessary
1113         if (this.initPageX || this.initPageX === 0) {
1114             // figure out how much this thing has moved
1115             var dx = (this.maintainOffset) ? this.lastPageX - this.initPageX : 0;
1116             var dy = (this.maintainOffset) ? this.lastPageY - this.initPageY : 0;
1117
1118             this.setInitPosition(dx, dy);
1119
1120         // This is the first time we have detected the element's position
1121         } else {
1122             this.setInitPosition();
1123         }
1124
1125         if (this.constrainX) {
1126             this.setXConstraint( this.leftConstraint,
1127                                  this.rightConstraint,
1128                                  this.xTickSize        );
1129         }
1130
1131         if (this.constrainY) {
1132             this.setYConstraint( this.topConstraint,
1133                                  this.bottomConstraint,
1134                                  this.yTickSize         );
1135         }
1136     },
1137
1138     /**
1139      * Normally the drag element is moved pixel by pixel, but we can specify
1140      * that it move a number of pixels at a time.  This method resolves the
1141      * location when we have it set up like this.
1142      * @method getTick
1143      * @param {int} val where we want to place the object
1144      * @param {int[]} tickArray sorted array of valid points
1145      * @return {int} the closest tick
1146      * @private
1147      */
1148     getTick: function(val, tickArray) {
1149
1150         if (!tickArray) {
1151             // If tick interval is not defined, it is effectively 1 pixel,
1152             // so we return the value passed to us.
1153             return val;
1154         } else if (tickArray[0] >= val) {
1155             // The value is lower than the first tick, so we return the first
1156             // tick.
1157             return tickArray[0];
1158         } else {
1159             for (var i=0, len=tickArray.length; i<len; ++i) {
1160                 var next = i + 1;
1161                 if (tickArray[next] && tickArray[next] >= val) {
1162                     var diff1 = val - tickArray[i];
1163                     var diff2 = tickArray[next] - val;
1164                     return (diff2 > diff1) ? tickArray[i] : tickArray[next];
1165                 }
1166             }
1167
1168             // The value is larger than the last tick, so we return the last
1169             // tick.
1170             return tickArray[tickArray.length - 1];
1171         }
1172     },
1173
1174     <div id="method-Ext.dd.DragDrop-toString"></div>/**
1175      * toString method
1176      * @method toString
1177      * @return {string} string representation of the dd obj
1178      */
1179     toString: function() {
1180         return ("DragDrop " + this.id);
1181     }
1182
1183 };
1184
1185 })();
1186 <div id="prop-Ext.dd.DragDrop-Only"></div>/**
1187  * The drag and drop utility provides a framework for building drag and drop
1188  * applications.  In addition to enabling drag and drop for specific elements,
1189  * the drag and drop elements are tracked by the manager class, and the
1190  * interactions between the various elements are tracked during the drag and
1191  * the implementing code is notified about these important moments.
1192  */
1193
1194 // Only load the library once.  Rewriting the manager class would orphan
1195 // existing drag and drop instances.
1196 if (!Ext.dd.DragDropMgr) {
1197
1198 <div id="cls-Ext.dd.DragDropMgr"></div>/**
1199  * @class Ext.dd.DragDropMgr
1200  * DragDropMgr is a singleton that tracks the element interaction for
1201  * all DragDrop items in the window.  Generally, you will not call
1202  * this class directly, but it does have helper methods that could
1203  * be useful in your DragDrop implementations.
1204  * @singleton
1205  */
1206 Ext.dd.DragDropMgr = function() {
1207
1208     var Event = Ext.EventManager;
1209
1210     return {
1211
1212         /**
1213          * Two dimensional Array of registered DragDrop objects.  The first
1214          * dimension is the DragDrop item group, the second the DragDrop
1215          * object.
1216          * @property ids
1217          * @type {string: string}
1218          * @private
1219          * @static
1220          */
1221         ids: {},
1222
1223         /**
1224          * Array of element ids defined as drag handles.  Used to determine
1225          * if the element that generated the mousedown event is actually the
1226          * handle and not the html element itself.
1227          * @property handleIds
1228          * @type {string: string}
1229          * @private
1230          * @static
1231          */
1232         handleIds: {},
1233
1234         /**
1235          * the DragDrop object that is currently being dragged
1236          * @property dragCurrent
1237          * @type DragDrop
1238          * @private
1239          * @static
1240          **/
1241         dragCurrent: null,
1242
1243         /**
1244          * the DragDrop object(s) that are being hovered over
1245          * @property dragOvers
1246          * @type Array
1247          * @private
1248          * @static
1249          */
1250         dragOvers: {},
1251
1252         /**
1253          * the X distance between the cursor and the object being dragged
1254          * @property deltaX
1255          * @type int
1256          * @private
1257          * @static
1258          */
1259         deltaX: 0,
1260
1261         /**
1262          * the Y distance between the cursor and the object being dragged
1263          * @property deltaY
1264          * @type int
1265          * @private
1266          * @static
1267          */
1268         deltaY: 0,
1269
1270         <div id="prop-Ext.dd.DragDropMgr-preventDefault"></div>/**
1271          * Flag to determine if we should prevent the default behavior of the
1272          * events we define. By default this is true, but this can be set to
1273          * false if you need the default behavior (not recommended)
1274          * @property preventDefault
1275          * @type boolean
1276          * @static
1277          */
1278         preventDefault: true,
1279
1280         <div id="prop-Ext.dd.DragDropMgr-stopPropagation"></div>/**
1281          * Flag to determine if we should stop the propagation of the events
1282          * we generate. This is true by default but you may want to set it to
1283          * false if the html element contains other features that require the
1284          * mouse click.
1285          * @property stopPropagation
1286          * @type boolean
1287          * @static
1288          */
1289         stopPropagation: true,
1290
1291         /**
1292          * Internal flag that is set to true when drag and drop has been
1293          * intialized
1294          * @property initialized
1295          * @private
1296          * @static
1297          */
1298         initialized: false,
1299
1300         /**
1301          * All drag and drop can be disabled.
1302          * @property locked
1303          * @private
1304          * @static
1305          */
1306         locked: false,
1307
1308         /**
1309          * Called the first time an element is registered.
1310          * @method init
1311          * @private
1312          * @static
1313          */
1314         init: function() {
1315             this.initialized = true;
1316         },
1317
1318         <div id="prop-Ext.dd.DragDropMgr-POINT"></div>/**
1319          * In point mode, drag and drop interaction is defined by the
1320          * location of the cursor during the drag/drop
1321          * @property POINT
1322          * @type int
1323          * @static
1324          */
1325         POINT: 0,
1326
1327         <div id="prop-Ext.dd.DragDropMgr-INTERSECT"></div>/**
1328          * In intersect mode, drag and drop interaction is defined by the
1329          * overlap of two or more drag and drop objects.
1330          * @property INTERSECT
1331          * @type int
1332          * @static
1333          */
1334         INTERSECT: 1,
1335
1336         <div id="prop-Ext.dd.DragDropMgr-mode"></div>/**
1337          * The current drag and drop mode.  Default: POINT
1338          * @property mode
1339          * @type int
1340          * @static
1341          */
1342         mode: 0,
1343
1344         /**
1345          * Runs method on all drag and drop objects
1346          * @method _execOnAll
1347          * @private
1348          * @static
1349          */
1350         _execOnAll: function(sMethod, args) {
1351             for (var i in this.ids) {
1352                 for (var j in this.ids[i]) {
1353                     var oDD = this.ids[i][j];
1354                     if (! this.isTypeOfDD(oDD)) {
1355                         continue;
1356                     }
1357                     oDD[sMethod].apply(oDD, args);
1358                 }
1359             }
1360         },
1361
1362         /**
1363          * Drag and drop initialization.  Sets up the global event handlers
1364          * @method _onLoad
1365          * @private
1366          * @static
1367          */
1368         _onLoad: function() {
1369
1370             this.init();
1371
1372
1373             Event.on(document, "mouseup",   this.handleMouseUp, this, true);
1374             Event.on(document, "mousemove", this.handleMouseMove, this, true);
1375             Event.on(window,   "unload",    this._onUnload, this, true);
1376             Event.on(window,   "resize",    this._onResize, this, true);
1377             // Event.on(window,   "mouseout",    this._test);
1378
1379         },
1380
1381         /**
1382          * Reset constraints on all drag and drop objs
1383          * @method _onResize
1384          * @private
1385          * @static
1386          */
1387         _onResize: function(e) {
1388             this._execOnAll("resetConstraints", []);
1389         },
1390
1391         <div id="method-Ext.dd.DragDropMgr-lock"></div>/**
1392          * Lock all drag and drop functionality
1393          * @method lock
1394          * @static
1395          */
1396         lock: function() { this.locked = true; },
1397
1398         <div id="method-Ext.dd.DragDropMgr-unlock"></div>/**
1399          * Unlock all drag and drop functionality
1400          * @method unlock
1401          * @static
1402          */
1403         unlock: function() { this.locked = false; },
1404
1405         <div id="method-Ext.dd.DragDropMgr-isLocked"></div>/**
1406          * Is drag and drop locked?
1407          * @method isLocked
1408          * @return {boolean} True if drag and drop is locked, false otherwise.
1409          * @static
1410          */
1411         isLocked: function() { return this.locked; },
1412
1413         /**
1414          * Location cache that is set for all drag drop objects when a drag is
1415          * initiated, cleared when the drag is finished.
1416          * @property locationCache
1417          * @private
1418          * @static
1419          */
1420         locationCache: {},
1421
1422         <div id="prop-Ext.dd.DragDropMgr-useCache"></div>/**
1423          * Set useCache to false if you want to force object the lookup of each
1424          * drag and drop linked element constantly during a drag.
1425          * @property useCache
1426          * @type boolean
1427          * @static
1428          */
1429         useCache: true,
1430
1431         <div id="prop-Ext.dd.DragDropMgr-clickPixelThresh"></div>/**
1432          * The number of pixels that the mouse needs to move after the
1433          * mousedown before the drag is initiated.  Default=3;
1434          * @property clickPixelThresh
1435          * @type int
1436          * @static
1437          */
1438         clickPixelThresh: 3,
1439
1440         <div id="prop-Ext.dd.DragDropMgr-clickTimeThresh"></div>/**
1441          * The number of milliseconds after the mousedown event to initiate the
1442          * drag if we don't get a mouseup event. Default=350
1443          * @property clickTimeThresh
1444          * @type int
1445          * @static
1446          */
1447         clickTimeThresh: 350,
1448
1449         /**
1450          * Flag that indicates that either the drag pixel threshold or the
1451          * mousdown time threshold has been met
1452          * @property dragThreshMet
1453          * @type boolean
1454          * @private
1455          * @static
1456          */
1457         dragThreshMet: false,
1458
1459         /**
1460          * Timeout used for the click time threshold
1461          * @property clickTimeout
1462          * @type Object
1463          * @private
1464          * @static
1465          */
1466         clickTimeout: null,
1467
1468         /**
1469          * The X position of the mousedown event stored for later use when a
1470          * drag threshold is met.
1471          * @property startX
1472          * @type int
1473          * @private
1474          * @static
1475          */
1476         startX: 0,
1477
1478         /**
1479          * The Y position of the mousedown event stored for later use when a
1480          * drag threshold is met.
1481          * @property startY
1482          * @type int
1483          * @private
1484          * @static
1485          */
1486         startY: 0,
1487
1488         <div id="method-Ext.dd.DragDropMgr-regDragDrop"></div>/**
1489          * Each DragDrop instance must be registered with the DragDropMgr.
1490          * This is executed in DragDrop.init()
1491          * @method regDragDrop
1492          * @param {DragDrop} oDD the DragDrop object to register
1493          * @param {String} sGroup the name of the group this element belongs to
1494          * @static
1495          */
1496         regDragDrop: function(oDD, sGroup) {
1497             if (!this.initialized) { this.init(); }
1498
1499             if (!this.ids[sGroup]) {
1500                 this.ids[sGroup] = {};
1501             }
1502             this.ids[sGroup][oDD.id] = oDD;
1503         },
1504
1505         /**
1506          * Removes the supplied dd instance from the supplied group. Executed
1507          * by DragDrop.removeFromGroup, so don't call this function directly.
1508          * @method removeDDFromGroup
1509          * @private
1510          * @static
1511          */
1512         removeDDFromGroup: function(oDD, sGroup) {
1513             if (!this.ids[sGroup]) {
1514                 this.ids[sGroup] = {};
1515             }
1516
1517             var obj = this.ids[sGroup];
1518             if (obj && obj[oDD.id]) {
1519                 delete obj[oDD.id];
1520             }
1521         },
1522
1523         /**
1524          * Unregisters a drag and drop item.  This is executed in
1525          * DragDrop.unreg, use that method instead of calling this directly.
1526          * @method _remove
1527          * @private
1528          * @static
1529          */
1530         _remove: function(oDD) {
1531             for (var g in oDD.groups) {
1532                 if (g && this.ids[g] && this.ids[g][oDD.id]) {
1533                     delete this.ids[g][oDD.id];
1534                 }
1535             }
1536             delete this.handleIds[oDD.id];
1537         },
1538
1539         <div id="method-Ext.dd.DragDropMgr-regHandle"></div>/**
1540          * Each DragDrop handle element must be registered.  This is done
1541          * automatically when executing DragDrop.setHandleElId()
1542          * @method regHandle
1543          * @param {String} sDDId the DragDrop id this element is a handle for
1544          * @param {String} sHandleId the id of the element that is the drag
1545          * handle
1546          * @static
1547          */
1548         regHandle: function(sDDId, sHandleId) {
1549             if (!this.handleIds[sDDId]) {
1550                 this.handleIds[sDDId] = {};
1551             }
1552             this.handleIds[sDDId][sHandleId] = sHandleId;
1553         },
1554
1555         <div id="method-Ext.dd.DragDropMgr-isDragDrop"></div>/**
1556          * Utility function to determine if a given element has been
1557          * registered as a drag drop item.
1558          * @method isDragDrop
1559          * @param {String} id the element id to check
1560          * @return {boolean} true if this element is a DragDrop item,
1561          * false otherwise
1562          * @static
1563          */
1564         isDragDrop: function(id) {
1565             return ( this.getDDById(id) ) ? true : false;
1566         },
1567
1568         <div id="method-Ext.dd.DragDropMgr-getRelated"></div>/**
1569          * Returns the drag and drop instances that are in all groups the
1570          * passed in instance belongs to.
1571          * @method getRelated
1572          * @param {DragDrop} p_oDD the obj to get related data for
1573          * @param {boolean} bTargetsOnly if true, only return targetable objs
1574          * @return {DragDrop[]} the related instances
1575          * @static
1576          */
1577         getRelated: function(p_oDD, bTargetsOnly) {
1578             var oDDs = [];
1579             for (var i in p_oDD.groups) {
1580                 for (var j in this.ids[i]) {
1581                     var dd = this.ids[i][j];
1582                     if (! this.isTypeOfDD(dd)) {
1583                         continue;
1584                     }
1585                     if (!bTargetsOnly || dd.isTarget) {
1586                         oDDs[oDDs.length] = dd;
1587                     }
1588                 }
1589             }
1590
1591             return oDDs;
1592         },
1593
1594         <div id="method-Ext.dd.DragDropMgr-isLegalTarget"></div>/**
1595          * Returns true if the specified dd target is a legal target for
1596          * the specifice drag obj
1597          * @method isLegalTarget
1598          * @param {DragDrop} the drag obj
1599          * @param {DragDrop} the target
1600          * @return {boolean} true if the target is a legal target for the
1601          * dd obj
1602          * @static
1603          */
1604         isLegalTarget: function (oDD, oTargetDD) {
1605             var targets = this.getRelated(oDD, true);
1606             for (var i=0, len=targets.length;i<len;++i) {
1607                 if (targets[i].id == oTargetDD.id) {
1608                     return true;
1609                 }
1610             }
1611
1612             return false;
1613         },
1614
1615         <div id="method-Ext.dd.DragDropMgr-isTypeOfDD"></div>/**
1616          * My goal is to be able to transparently determine if an object is
1617          * typeof DragDrop, and the exact subclass of DragDrop.  typeof
1618          * returns "object", oDD.constructor.toString() always returns
1619          * "DragDrop" and not the name of the subclass.  So for now it just
1620          * evaluates a well-known variable in DragDrop.
1621          * @method isTypeOfDD
1622          * @param {Object} the object to evaluate
1623          * @return {boolean} true if typeof oDD = DragDrop
1624          * @static
1625          */
1626         isTypeOfDD: function (oDD) {
1627             return (oDD && oDD.__ygDragDrop);
1628         },
1629
1630         <div id="method-Ext.dd.DragDropMgr-isHandle"></div>/**
1631          * Utility function to determine if a given element has been
1632          * registered as a drag drop handle for the given Drag Drop object.
1633          * @method isHandle
1634          * @param {String} id the element id to check
1635          * @return {boolean} true if this element is a DragDrop handle, false
1636          * otherwise
1637          * @static
1638          */
1639         isHandle: function(sDDId, sHandleId) {
1640             return ( this.handleIds[sDDId] &&
1641                             this.handleIds[sDDId][sHandleId] );
1642         },
1643
1644         <div id="method-Ext.dd.DragDropMgr-getDDById"></div>/**
1645          * Returns the DragDrop instance for a given id
1646          * @method getDDById
1647          * @param {String} id the id of the DragDrop object
1648          * @return {DragDrop} the drag drop object, null if it is not found
1649          * @static
1650          */
1651         getDDById: function(id) {
1652             for (var i in this.ids) {
1653                 if (this.ids[i][id]) {
1654                     return this.ids[i][id];
1655                 }
1656             }
1657             return null;
1658         },
1659
1660         /**
1661          * Fired after a registered DragDrop object gets the mousedown event.
1662          * Sets up the events required to track the object being dragged
1663          * @method handleMouseDown
1664          * @param {Event} e the event
1665          * @param oDD the DragDrop object being dragged
1666          * @private
1667          * @static
1668          */
1669         handleMouseDown: function(e, oDD) {
1670             if(Ext.QuickTips){
1671                 Ext.QuickTips.disable();
1672             }
1673             if(this.dragCurrent){
1674                 // the original browser mouseup wasn't handled (e.g. outside FF browser window)
1675                 // so clean up first to avoid breaking the next drag
1676                 this.handleMouseUp(e);
1677             }
1678             
1679             this.currentTarget = e.getTarget();
1680             this.dragCurrent = oDD;
1681
1682             var el = oDD.getEl();
1683
1684             // track start position
1685             this.startX = e.getPageX();
1686             this.startY = e.getPageY();
1687
1688             this.deltaX = this.startX - el.offsetLeft;
1689             this.deltaY = this.startY - el.offsetTop;
1690
1691             this.dragThreshMet = false;
1692
1693             this.clickTimeout = setTimeout(
1694                     function() {
1695                         var DDM = Ext.dd.DDM;
1696                         DDM.startDrag(DDM.startX, DDM.startY);
1697                     },
1698                     this.clickTimeThresh );
1699         },
1700
1701         <div id="method-Ext.dd.DragDropMgr-startDrag"></div>/**
1702          * Fired when either the drag pixel threshol or the mousedown hold
1703          * time threshold has been met.
1704          * @method startDrag
1705          * @param x {int} the X position of the original mousedown
1706          * @param y {int} the Y position of the original mousedown
1707          * @static
1708          */
1709         startDrag: function(x, y) {
1710             clearTimeout(this.clickTimeout);
1711             if (this.dragCurrent) {
1712                 this.dragCurrent.b4StartDrag(x, y);
1713                 this.dragCurrent.startDrag(x, y);
1714             }
1715             this.dragThreshMet = true;
1716         },
1717
1718         /**
1719          * Internal function to handle the mouseup event.  Will be invoked
1720          * from the context of the document.
1721          * @method handleMouseUp
1722          * @param {Event} e the event
1723          * @private
1724          * @static
1725          */
1726         handleMouseUp: function(e) {
1727
1728             if(Ext.QuickTips){
1729                 Ext.QuickTips.enable();
1730             }
1731             if (! this.dragCurrent) {
1732                 return;
1733             }
1734
1735             clearTimeout(this.clickTimeout);
1736
1737             if (this.dragThreshMet) {
1738                 this.fireEvents(e, true);
1739             } else {
1740             }
1741
1742             this.stopDrag(e);
1743
1744             this.stopEvent(e);
1745         },
1746
1747         <div id="method-Ext.dd.DragDropMgr-stopEvent"></div>/**
1748          * Utility to stop event propagation and event default, if these
1749          * features are turned on.
1750          * @method stopEvent
1751          * @param {Event} e the event as returned by this.getEvent()
1752          * @static
1753          */
1754         stopEvent: function(e){
1755             if(this.stopPropagation) {
1756                 e.stopPropagation();
1757             }
1758
1759             if (this.preventDefault) {
1760                 e.preventDefault();
1761             }
1762         },
1763
1764         /**
1765          * Internal function to clean up event handlers after the drag
1766          * operation is complete
1767          * @method stopDrag
1768          * @param {Event} e the event
1769          * @private
1770          * @static
1771          */
1772         stopDrag: function(e) {
1773             // Fire the drag end event for the item that was dragged
1774             if (this.dragCurrent) {
1775                 if (this.dragThreshMet) {
1776                     this.dragCurrent.b4EndDrag(e);
1777                     this.dragCurrent.endDrag(e);
1778                 }
1779
1780                 this.dragCurrent.onMouseUp(e);
1781             }
1782
1783             this.dragCurrent = null;
1784             this.dragOvers = {};
1785         },
1786
1787         /**
1788          * Internal function to handle the mousemove event.  Will be invoked
1789          * from the context of the html element.
1790          *
1791          * @TODO figure out what we can do about mouse events lost when the
1792          * user drags objects beyond the window boundary.  Currently we can
1793          * detect this in internet explorer by verifying that the mouse is
1794          * down during the mousemove event.  Firefox doesn't give us the
1795          * button state on the mousemove event.
1796          * @method handleMouseMove
1797          * @param {Event} e the event
1798          * @private
1799          * @static
1800          */
1801         handleMouseMove: function(e) {
1802             if (! this.dragCurrent) {
1803                 return true;
1804             }
1805             // var button = e.which || e.button;
1806
1807             // check for IE mouseup outside of page boundary
1808             if (Ext.isIE && (e.button !== 0 && e.button !== 1 && e.button !== 2)) {
1809                 this.stopEvent(e);
1810                 return this.handleMouseUp(e);
1811             }
1812
1813             if (!this.dragThreshMet) {
1814                 var diffX = Math.abs(this.startX - e.getPageX());
1815                 var diffY = Math.abs(this.startY - e.getPageY());
1816                 if (diffX > this.clickPixelThresh ||
1817                             diffY > this.clickPixelThresh) {
1818                     this.startDrag(this.startX, this.startY);
1819                 }
1820             }
1821
1822             if (this.dragThreshMet) {
1823                 this.dragCurrent.b4Drag(e);
1824                 this.dragCurrent.onDrag(e);
1825                 if(!this.dragCurrent.moveOnly){
1826                     this.fireEvents(e, false);
1827                 }
1828             }
1829
1830             this.stopEvent(e);
1831
1832             return true;
1833         },
1834
1835         /**
1836          * Iterates over all of the DragDrop elements to find ones we are
1837          * hovering over or dropping on
1838          * @method fireEvents
1839          * @param {Event} e the event
1840          * @param {boolean} isDrop is this a drop op or a mouseover op?
1841          * @private
1842          * @static
1843          */
1844         fireEvents: function(e, isDrop) {
1845             var dc = this.dragCurrent;
1846
1847             // If the user did the mouse up outside of the window, we could
1848             // get here even though we have ended the drag.
1849             if (!dc || dc.isLocked()) {
1850                 return;
1851             }
1852
1853             var pt = e.getPoint();
1854
1855             // cache the previous dragOver array
1856             var oldOvers = [];
1857
1858             var outEvts   = [];
1859             var overEvts  = [];
1860             var dropEvts  = [];
1861             var enterEvts = [];
1862
1863             // Check to see if the object(s) we were hovering over is no longer
1864             // being hovered over so we can fire the onDragOut event
1865             for (var i in this.dragOvers) {
1866
1867                 var ddo = this.dragOvers[i];
1868
1869                 if (! this.isTypeOfDD(ddo)) {
1870                     continue;
1871                 }
1872
1873                 if (! this.isOverTarget(pt, ddo, this.mode)) {
1874                     outEvts.push( ddo );
1875                 }
1876
1877                 oldOvers[i] = true;
1878                 delete this.dragOvers[i];
1879             }
1880
1881             for (var sGroup in dc.groups) {
1882
1883                 if ("string" != typeof sGroup) {
1884                     continue;
1885                 }
1886
1887                 for (i in this.ids[sGroup]) {
1888                     var oDD = this.ids[sGroup][i];
1889                     if (! this.isTypeOfDD(oDD)) {
1890                         continue;
1891                     }
1892
1893                     if (oDD.isTarget && !oDD.isLocked() && ((oDD != dc) || (dc.ignoreSelf === false))) {
1894                         if (this.isOverTarget(pt, oDD, this.mode)) {
1895                             // look for drop interactions
1896                             if (isDrop) {
1897                                 dropEvts.push( oDD );
1898                             // look for drag enter and drag over interactions
1899                             } else {
1900
1901                                 // initial drag over: dragEnter fires
1902                                 if (!oldOvers[oDD.id]) {
1903                                     enterEvts.push( oDD );
1904                                 // subsequent drag overs: dragOver fires
1905                                 } else {
1906                                     overEvts.push( oDD );
1907                                 }
1908
1909                                 this.dragOvers[oDD.id] = oDD;
1910                             }
1911                         }
1912                     }
1913                 }
1914             }
1915
1916             if (this.mode) {
1917                 if (outEvts.length) {
1918                     dc.b4DragOut(e, outEvts);
1919                     dc.onDragOut(e, outEvts);
1920                 }
1921
1922                 if (enterEvts.length) {
1923                     dc.onDragEnter(e, enterEvts);
1924                 }
1925
1926                 if (overEvts.length) {
1927                     dc.b4DragOver(e, overEvts);
1928                     dc.onDragOver(e, overEvts);
1929                 }
1930
1931                 if (dropEvts.length) {
1932                     dc.b4DragDrop(e, dropEvts);
1933                     dc.onDragDrop(e, dropEvts);
1934                 }
1935
1936             } else {
1937                 // fire dragout events
1938                 var len = 0;
1939                 for (i=0, len=outEvts.length; i<len; ++i) {
1940                     dc.b4DragOut(e, outEvts[i].id);
1941                     dc.onDragOut(e, outEvts[i].id);
1942                 }
1943
1944                 // fire enter events
1945                 for (i=0,len=enterEvts.length; i<len; ++i) {
1946                     // dc.b4DragEnter(e, oDD.id);
1947                     dc.onDragEnter(e, enterEvts[i].id);
1948                 }
1949
1950                 // fire over events
1951                 for (i=0,len=overEvts.length; i<len; ++i) {
1952                     dc.b4DragOver(e, overEvts[i].id);
1953                     dc.onDragOver(e, overEvts[i].id);
1954                 }
1955
1956                 // fire drop events
1957                 for (i=0, len=dropEvts.length; i<len; ++i) {
1958                     dc.b4DragDrop(e, dropEvts[i].id);
1959                     dc.onDragDrop(e, dropEvts[i].id);
1960                 }
1961
1962             }
1963
1964             // notify about a drop that did not find a target
1965             if (isDrop && !dropEvts.length) {
1966                 dc.onInvalidDrop(e);
1967             }
1968
1969         },
1970
1971         <div id="method-Ext.dd.DragDropMgr-getBestMatch"></div>/**
1972          * Helper function for getting the best match from the list of drag
1973          * and drop objects returned by the drag and drop events when we are
1974          * in INTERSECT mode.  It returns either the first object that the
1975          * cursor is over, or the object that has the greatest overlap with
1976          * the dragged element.
1977          * @method getBestMatch
1978          * @param  {DragDrop[]} dds The array of drag and drop objects
1979          * targeted
1980          * @return {DragDrop}       The best single match
1981          * @static
1982          */
1983         getBestMatch: function(dds) {
1984             var winner = null;
1985             // Return null if the input is not what we expect
1986             //if (!dds || !dds.length || dds.length == 0) {
1987                // winner = null;
1988             // If there is only one item, it wins
1989             //} else if (dds.length == 1) {
1990
1991             var len = dds.length;
1992
1993             if (len == 1) {
1994                 winner = dds[0];
1995             } else {
1996                 // Loop through the targeted items
1997                 for (var i=0; i<len; ++i) {
1998                     var dd = dds[i];
1999                     // If the cursor is over the object, it wins.  If the
2000                     // cursor is over multiple matches, the first one we come
2001                     // to wins.
2002                     if (dd.cursorIsOver) {
2003                         winner = dd;
2004                         break;
2005                     // Otherwise the object with the most overlap wins
2006                     } else {
2007                         if (!winner ||
2008                             winner.overlap.getArea() < dd.overlap.getArea()) {
2009                             winner = dd;
2010                         }
2011                     }
2012                 }
2013             }
2014
2015             return winner;
2016         },
2017
2018         <div id="method-Ext.dd.DragDropMgr-refreshCache"></div>/**
2019          * Refreshes the cache of the top-left and bottom-right points of the
2020          * drag and drop objects in the specified group(s).  This is in the
2021          * format that is stored in the drag and drop instance, so typical
2022          * usage is:
2023          * <code>
2024          * Ext.dd.DragDropMgr.refreshCache(ddinstance.groups);
2025          * </code>
2026          * Alternatively:
2027          * <code>
2028          * Ext.dd.DragDropMgr.refreshCache({group1:true, group2:true});
2029          * </code>
2030          * @TODO this really should be an indexed array.  Alternatively this
2031          * method could accept both.
2032          * @method refreshCache
2033          * @param {Object} groups an associative array of groups to refresh
2034          * @static
2035          */
2036         refreshCache: function(groups) {
2037             for (var sGroup in groups) {
2038                 if ("string" != typeof sGroup) {
2039                     continue;
2040                 }
2041                 for (var i in this.ids[sGroup]) {
2042                     var oDD = this.ids[sGroup][i];
2043
2044                     if (this.isTypeOfDD(oDD)) {
2045                     // if (this.isTypeOfDD(oDD) && oDD.isTarget) {
2046                         var loc = this.getLocation(oDD);
2047                         if (loc) {
2048                             this.locationCache[oDD.id] = loc;
2049                         } else {
2050                             delete this.locationCache[oDD.id];
2051                             // this will unregister the drag and drop object if
2052                             // the element is not in a usable state
2053                             // oDD.unreg();
2054                         }
2055                     }
2056                 }
2057             }
2058         },
2059
2060         <div id="method-Ext.dd.DragDropMgr-verifyEl"></div>/**
2061          * This checks to make sure an element exists and is in the DOM.  The
2062          * main purpose is to handle cases where innerHTML is used to remove
2063          * drag and drop objects from the DOM.  IE provides an 'unspecified
2064          * error' when trying to access the offsetParent of such an element
2065          * @method verifyEl
2066          * @param {HTMLElement} el the element to check
2067          * @return {boolean} true if the element looks usable
2068          * @static
2069          */
2070         verifyEl: function(el) {
2071             if (el) {
2072                 var parent;
2073                 if(Ext.isIE){
2074                     try{
2075                         parent = el.offsetParent;
2076                     }catch(e){}
2077                 }else{
2078                     parent = el.offsetParent;
2079                 }
2080                 if (parent) {
2081                     return true;
2082                 }
2083             }
2084
2085             return false;
2086         },
2087
2088         <div id="method-Ext.dd.DragDropMgr-getLocation"></div>/**
2089          * Returns a Region object containing the drag and drop element's position
2090          * and size, including the padding configured for it
2091          * @method getLocation
2092          * @param {DragDrop} oDD the drag and drop object to get the
2093          *                       location for
2094          * @return {Ext.lib.Region} a Region object representing the total area
2095          *                             the element occupies, including any padding
2096          *                             the instance is configured for.
2097          * @static
2098          */
2099         getLocation: function(oDD) {
2100             if (! this.isTypeOfDD(oDD)) {
2101                 return null;
2102             }
2103
2104             var el = oDD.getEl(), pos, x1, x2, y1, y2, t, r, b, l;
2105
2106             try {
2107                 pos= Ext.lib.Dom.getXY(el);
2108             } catch (e) { }
2109
2110             if (!pos) {
2111                 return null;
2112             }
2113
2114             x1 = pos[0];
2115             x2 = x1 + el.offsetWidth;
2116             y1 = pos[1];
2117             y2 = y1 + el.offsetHeight;
2118
2119             t = y1 - oDD.padding[0];
2120             r = x2 + oDD.padding[1];
2121             b = y2 + oDD.padding[2];
2122             l = x1 - oDD.padding[3];
2123
2124             return new Ext.lib.Region( t, r, b, l );
2125         },
2126
2127         /**
2128          * Checks the cursor location to see if it over the target
2129          * @method isOverTarget
2130          * @param {Ext.lib.Point} pt The point to evaluate
2131          * @param {DragDrop} oTarget the DragDrop object we are inspecting
2132          * @return {boolean} true if the mouse is over the target
2133          * @private
2134          * @static
2135          */
2136         isOverTarget: function(pt, oTarget, intersect) {
2137             // use cache if available
2138             var loc = this.locationCache[oTarget.id];
2139             if (!loc || !this.useCache) {
2140                 loc = this.getLocation(oTarget);
2141                 this.locationCache[oTarget.id] = loc;
2142
2143             }
2144
2145             if (!loc) {
2146                 return false;
2147             }
2148
2149             oTarget.cursorIsOver = loc.contains( pt );
2150
2151             // DragDrop is using this as a sanity check for the initial mousedown
2152             // in this case we are done.  In POINT mode, if the drag obj has no
2153             // contraints, we are also done. Otherwise we need to evaluate the
2154             // location of the target as related to the actual location of the
2155             // dragged element.
2156             var dc = this.dragCurrent;
2157             if (!dc || !dc.getTargetCoord ||
2158                     (!intersect && !dc.constrainX && !dc.constrainY)) {
2159                 return oTarget.cursorIsOver;
2160             }
2161
2162             oTarget.overlap = null;
2163
2164             // Get the current location of the drag element, this is the
2165             // location of the mouse event less the delta that represents
2166             // where the original mousedown happened on the element.  We
2167             // need to consider constraints and ticks as well.
2168             var pos = dc.getTargetCoord(pt.x, pt.y);
2169
2170             var el = dc.getDragEl();
2171             var curRegion = new Ext.lib.Region( pos.y,
2172                                                    pos.x + el.offsetWidth,
2173                                                    pos.y + el.offsetHeight,
2174                                                    pos.x );
2175
2176             var overlap = curRegion.intersect(loc);
2177
2178             if (overlap) {
2179                 oTarget.overlap = overlap;
2180                 return (intersect) ? true : oTarget.cursorIsOver;
2181             } else {
2182                 return false;
2183             }
2184         },
2185
2186         /**
2187          * unload event handler
2188          * @method _onUnload
2189          * @private
2190          * @static
2191          */
2192         _onUnload: function(e, me) {
2193             Ext.dd.DragDropMgr.unregAll();
2194         },
2195
2196         /**
2197          * Cleans up the drag and drop events and objects.
2198          * @method unregAll
2199          * @private
2200          * @static
2201          */
2202         unregAll: function() {
2203
2204             if (this.dragCurrent) {
2205                 this.stopDrag();
2206                 this.dragCurrent = null;
2207             }
2208
2209             this._execOnAll("unreg", []);
2210
2211             for (var i in this.elementCache) {
2212                 delete this.elementCache[i];
2213             }
2214
2215             this.elementCache = {};
2216             this.ids = {};
2217         },
2218
2219         /**
2220          * A cache of DOM elements
2221          * @property elementCache
2222          * @private
2223          * @static
2224          */
2225         elementCache: {},
2226
2227         /**
2228          * Get the wrapper for the DOM element specified
2229          * @method getElWrapper
2230          * @param {String} id the id of the element to get
2231          * @return {Ext.dd.DDM.ElementWrapper} the wrapped element
2232          * @private
2233          * @deprecated This wrapper isn't that useful
2234          * @static
2235          */
2236         getElWrapper: function(id) {
2237             var oWrapper = this.elementCache[id];
2238             if (!oWrapper || !oWrapper.el) {
2239                 oWrapper = this.elementCache[id] =
2240                     new this.ElementWrapper(Ext.getDom(id));
2241             }
2242             return oWrapper;
2243         },
2244
2245         <div id="method-Ext.dd.DragDropMgr-getElement"></div>/**
2246          * Returns the actual DOM element
2247          * @method getElement
2248          * @param {String} id the id of the elment to get
2249          * @return {Object} The element
2250          * @deprecated use Ext.lib.Ext.getDom instead
2251          * @static
2252          */
2253         getElement: function(id) {
2254             return Ext.getDom(id);
2255         },
2256
2257         <div id="method-Ext.dd.DragDropMgr-getCss"></div>/**
2258          * Returns the style property for the DOM element (i.e.,
2259          * document.getElById(id).style)
2260          * @method getCss
2261          * @param {String} id the id of the elment to get
2262          * @return {Object} The style property of the element
2263          * @deprecated use Ext.lib.Dom instead
2264          * @static
2265          */
2266         getCss: function(id) {
2267             var el = Ext.getDom(id);
2268             return (el) ? el.style : null;
2269         },
2270
2271         <div id="cls-DragDropMgr.ElementWrapper"></div>/**
2272          * Inner class for cached elements
2273          * @class DragDropMgr.ElementWrapper
2274          * @for DragDropMgr
2275          * @private
2276          * @deprecated
2277          */
2278         ElementWrapper: function(el) {
2279                 <div id="prop-DragDropMgr.ElementWrapper-el"></div>/**
2280                  * The element
2281                  * @property el
2282                  */
2283                 this.el = el || null;
2284                 <div id="prop-DragDropMgr.ElementWrapper-id"></div>/**
2285                  * The element id
2286                  * @property id
2287                  */
2288                 this.id = this.el && el.id;
2289                 <div id="prop-DragDropMgr.ElementWrapper-css"></div>/**
2290                  * A reference to the style property
2291                  * @property css
2292                  */
2293                 this.css = this.el && el.style;
2294             },
2295
2296         <div id="method-DragDropMgr.ElementWrapper-getPosX"></div>/**
2297          * Returns the X position of an html element
2298          * @method getPosX
2299          * @param el the element for which to get the position
2300          * @return {int} the X coordinate
2301          * @for DragDropMgr
2302          * @deprecated use Ext.lib.Dom.getX instead
2303          * @static
2304          */
2305         getPosX: function(el) {
2306             return Ext.lib.Dom.getX(el);
2307         },
2308
2309         <div id="method-DragDropMgr.ElementWrapper-getPosY"></div>/**
2310          * Returns the Y position of an html element
2311          * @method getPosY
2312          * @param el the element for which to get the position
2313          * @return {int} the Y coordinate
2314          * @deprecated use Ext.lib.Dom.getY instead
2315          * @static
2316          */
2317         getPosY: function(el) {
2318             return Ext.lib.Dom.getY(el);
2319         },
2320
2321         <div id="method-DragDropMgr.ElementWrapper-swapNode"></div>/**
2322          * Swap two nodes.  In IE, we use the native method, for others we
2323          * emulate the IE behavior
2324          * @method swapNode
2325          * @param n1 the first node to swap
2326          * @param n2 the other node to swap
2327          * @static
2328          */
2329         swapNode: function(n1, n2) {
2330             if (n1.swapNode) {
2331                 n1.swapNode(n2);
2332             } else {
2333                 var p = n2.parentNode;
2334                 var s = n2.nextSibling;
2335
2336                 if (s == n1) {
2337                     p.insertBefore(n1, n2);
2338                 } else if (n2 == n1.nextSibling) {
2339                     p.insertBefore(n2, n1);
2340                 } else {
2341                     n1.parentNode.replaceChild(n2, n1);
2342                     p.insertBefore(n1, s);
2343                 }
2344             }
2345         },
2346
2347         /**
2348          * Returns the current scroll position
2349          * @method getScroll
2350          * @private
2351          * @static
2352          */
2353         getScroll: function () {
2354             var t, l, dde=document.documentElement, db=document.body;
2355             if (dde && (dde.scrollTop || dde.scrollLeft)) {
2356                 t = dde.scrollTop;
2357                 l = dde.scrollLeft;
2358             } else if (db) {
2359                 t = db.scrollTop;
2360                 l = db.scrollLeft;
2361             } else {
2362
2363             }
2364             return { top: t, left: l };
2365         },
2366
2367         <div id="method-DragDropMgr.ElementWrapper-getStyle"></div>/**
2368          * Returns the specified element style property
2369          * @method getStyle
2370          * @param {HTMLElement} el          the element
2371          * @param {string}      styleProp   the style property
2372          * @return {string} The value of the style property
2373          * @deprecated use Ext.lib.Dom.getStyle
2374          * @static
2375          */
2376         getStyle: function(el, styleProp) {
2377             return Ext.fly(el).getStyle(styleProp);
2378         },
2379
2380         <div id="method-DragDropMgr.ElementWrapper-getScrollTop"></div>/**
2381          * Gets the scrollTop
2382          * @method getScrollTop
2383          * @return {int} the document's scrollTop
2384          * @static
2385          */
2386         getScrollTop: function () { return this.getScroll().top; },
2387
2388         <div id="method-DragDropMgr.ElementWrapper-getScrollLeft"></div>/**
2389          * Gets the scrollLeft
2390          * @method getScrollLeft
2391          * @return {int} the document's scrollTop
2392          * @static
2393          */
2394         getScrollLeft: function () { return this.getScroll().left; },
2395
2396         <div id="method-DragDropMgr.ElementWrapper-moveToEl"></div>/**
2397          * Sets the x/y position of an element to the location of the
2398          * target element.
2399          * @method moveToEl
2400          * @param {HTMLElement} moveEl      The element to move
2401          * @param {HTMLElement} targetEl    The position reference element
2402          * @static
2403          */
2404         moveToEl: function (moveEl, targetEl) {
2405             var aCoord = Ext.lib.Dom.getXY(targetEl);
2406             Ext.lib.Dom.setXY(moveEl, aCoord);
2407         },
2408
2409         <div id="method-DragDropMgr.ElementWrapper-numericSort"></div>/**
2410          * Numeric array sort function
2411          * @method numericSort
2412          * @static
2413          */
2414         numericSort: function(a, b) { return (a - b); },
2415
2416         /**
2417          * Internal counter
2418          * @property _timeoutCount
2419          * @private
2420          * @static
2421          */
2422         _timeoutCount: 0,
2423
2424         /**
2425          * Trying to make the load order less important.  Without this we get
2426          * an error if this file is loaded before the Event Utility.
2427          * @method _addListeners
2428          * @private
2429          * @static
2430          */
2431         _addListeners: function() {
2432             var DDM = Ext.dd.DDM;
2433             if ( Ext.lib.Event && document ) {
2434                 DDM._onLoad();
2435             } else {
2436                 if (DDM._timeoutCount > 2000) {
2437                 } else {
2438                     setTimeout(DDM._addListeners, 10);
2439                     if (document && document.body) {
2440                         DDM._timeoutCount += 1;
2441                     }
2442                 }
2443             }
2444         },
2445
2446         <div id="method-DragDropMgr.ElementWrapper-handleWasClicked"></div>/**
2447          * Recursively searches the immediate parent and all child nodes for
2448          * the handle element in order to determine wheter or not it was
2449          * clicked.
2450          * @method handleWasClicked
2451          * @param node the html element to inspect
2452          * @static
2453          */
2454         handleWasClicked: function(node, id) {
2455             if (this.isHandle(id, node.id)) {
2456                 return true;
2457             } else {
2458                 // check to see if this is a text node child of the one we want
2459                 var p = node.parentNode;
2460
2461                 while (p) {
2462                     if (this.isHandle(id, p.id)) {
2463                         return true;
2464                     } else {
2465                         p = p.parentNode;
2466                     }
2467                 }
2468             }
2469
2470             return false;
2471         }
2472
2473     };
2474
2475 }();
2476
2477 // shorter alias, save a few bytes
2478 Ext.dd.DDM = Ext.dd.DragDropMgr;
2479 Ext.dd.DDM._addListeners();
2480
2481 }
2482
2483 <div id="cls-Ext.dd.DD"></div>/**
2484  * @class Ext.dd.DD
2485  * A DragDrop implementation where the linked element follows the
2486  * mouse cursor during a drag.
2487  * @extends Ext.dd.DragDrop
2488  * @constructor
2489  * @param {String} id the id of the linked element
2490  * @param {String} sGroup the group of related DragDrop items
2491  * @param {object} config an object containing configurable attributes
2492  *                Valid properties for DD:
2493  *                    scroll
2494  */
2495 Ext.dd.DD = function(id, sGroup, config) {
2496     if (id) {
2497         this.init(id, sGroup, config);
2498     }
2499 };
2500
2501 Ext.extend(Ext.dd.DD, Ext.dd.DragDrop, {
2502
2503     <div id="prop-Ext.dd.DD-scroll"></div>/**
2504      * When set to true, the utility automatically tries to scroll the browser
2505      * window when a drag and drop element is dragged near the viewport boundary.
2506      * Defaults to true.
2507      * @property scroll
2508      * @type boolean
2509      */
2510     scroll: true,
2511
2512     <div id="method-Ext.dd.DD-autoOffset"></div>/**
2513      * Sets the pointer offset to the distance between the linked element's top
2514      * left corner and the location the element was clicked
2515      * @method autoOffset
2516      * @param {int} iPageX the X coordinate of the click
2517      * @param {int} iPageY the Y coordinate of the click
2518      */
2519     autoOffset: function(iPageX, iPageY) {
2520         var x = iPageX - this.startPageX;
2521         var y = iPageY - this.startPageY;
2522         this.setDelta(x, y);
2523     },
2524
2525     <div id="method-Ext.dd.DD-setDelta"></div>/**
2526      * Sets the pointer offset.  You can call this directly to force the
2527      * offset to be in a particular location (e.g., pass in 0,0 to set it
2528      * to the center of the object)
2529      * @method setDelta
2530      * @param {int} iDeltaX the distance from the left
2531      * @param {int} iDeltaY the distance from the top
2532      */
2533     setDelta: function(iDeltaX, iDeltaY) {
2534         this.deltaX = iDeltaX;
2535         this.deltaY = iDeltaY;
2536     },
2537
2538     <div id="method-Ext.dd.DD-setDragElPos"></div>/**
2539      * Sets the drag element to the location of the mousedown or click event,
2540      * maintaining the cursor location relative to the location on the element
2541      * that was clicked.  Override this if you want to place the element in a
2542      * location other than where the cursor is.
2543      * @method setDragElPos
2544      * @param {int} iPageX the X coordinate of the mousedown or drag event
2545      * @param {int} iPageY the Y coordinate of the mousedown or drag event
2546      */
2547     setDragElPos: function(iPageX, iPageY) {
2548         // the first time we do this, we are going to check to make sure
2549         // the element has css positioning
2550
2551         var el = this.getDragEl();
2552         this.alignElWithMouse(el, iPageX, iPageY);
2553     },
2554
2555     <div id="method-Ext.dd.DD-alignElWithMouse"></div>/**
2556      * Sets the element to the location of the mousedown or click event,
2557      * maintaining the cursor location relative to the location on the element
2558      * that was clicked.  Override this if you want to place the element in a
2559      * location other than where the cursor is.
2560      * @method alignElWithMouse
2561      * @param {HTMLElement} el the element to move
2562      * @param {int} iPageX the X coordinate of the mousedown or drag event
2563      * @param {int} iPageY the Y coordinate of the mousedown or drag event
2564      */
2565     alignElWithMouse: function(el, iPageX, iPageY) {
2566         var oCoord = this.getTargetCoord(iPageX, iPageY);
2567         var fly = el.dom ? el : Ext.fly(el, '_dd');
2568         if (!this.deltaSetXY) {
2569             var aCoord = [oCoord.x, oCoord.y];
2570             fly.setXY(aCoord);
2571             var newLeft = fly.getLeft(true);
2572             var newTop  = fly.getTop(true);
2573             this.deltaSetXY = [ newLeft - oCoord.x, newTop - oCoord.y ];
2574         } else {
2575             fly.setLeftTop(oCoord.x + this.deltaSetXY[0], oCoord.y + this.deltaSetXY[1]);
2576         }
2577
2578         this.cachePosition(oCoord.x, oCoord.y);
2579         this.autoScroll(oCoord.x, oCoord.y, el.offsetHeight, el.offsetWidth);
2580         return oCoord;
2581     },
2582
2583     <div id="method-Ext.dd.DD-cachePosition"></div>/**
2584      * Saves the most recent position so that we can reset the constraints and
2585      * tick marks on-demand.  We need to know this so that we can calculate the
2586      * number of pixels the element is offset from its original position.
2587      * @method cachePosition
2588      * @param iPageX the current x position (optional, this just makes it so we
2589      * don't have to look it up again)
2590      * @param iPageY the current y position (optional, this just makes it so we
2591      * don't have to look it up again)
2592      */
2593     cachePosition: function(iPageX, iPageY) {
2594         if (iPageX) {
2595             this.lastPageX = iPageX;
2596             this.lastPageY = iPageY;
2597         } else {
2598             var aCoord = Ext.lib.Dom.getXY(this.getEl());
2599             this.lastPageX = aCoord[0];
2600             this.lastPageY = aCoord[1];
2601         }
2602     },
2603
2604     /**
2605      * Auto-scroll the window if the dragged object has been moved beyond the
2606      * visible window boundary.
2607      * @method autoScroll
2608      * @param {int} x the drag element's x position
2609      * @param {int} y the drag element's y position
2610      * @param {int} h the height of the drag element
2611      * @param {int} w the width of the drag element
2612      * @private
2613      */
2614     autoScroll: function(x, y, h, w) {
2615
2616         if (this.scroll) {
2617             // The client height
2618             var clientH = Ext.lib.Dom.getViewHeight();
2619
2620             // The client width
2621             var clientW = Ext.lib.Dom.getViewWidth();
2622
2623             // The amt scrolled down
2624             var st = this.DDM.getScrollTop();
2625
2626             // The amt scrolled right
2627             var sl = this.DDM.getScrollLeft();
2628
2629             // Location of the bottom of the element
2630             var bot = h + y;
2631
2632             // Location of the right of the element
2633             var right = w + x;
2634
2635             // The distance from the cursor to the bottom of the visible area,
2636             // adjusted so that we don't scroll if the cursor is beyond the
2637             // element drag constraints
2638             var toBot = (clientH + st - y - this.deltaY);
2639
2640             // The distance from the cursor to the right of the visible area
2641             var toRight = (clientW + sl - x - this.deltaX);
2642
2643
2644             // How close to the edge the cursor must be before we scroll
2645             // var thresh = (document.all) ? 100 : 40;
2646             var thresh = 40;
2647
2648             // How many pixels to scroll per autoscroll op.  This helps to reduce
2649             // clunky scrolling. IE is more sensitive about this ... it needs this
2650             // value to be higher.
2651             var scrAmt = (document.all) ? 80 : 30;
2652
2653             // Scroll down if we are near the bottom of the visible page and the
2654             // obj extends below the crease
2655             if ( bot > clientH && toBot < thresh ) {
2656                 window.scrollTo(sl, st + scrAmt);
2657             }
2658
2659             // Scroll up if the window is scrolled down and the top of the object
2660             // goes above the top border
2661             if ( y < st && st > 0 && y - st < thresh ) {
2662                 window.scrollTo(sl, st - scrAmt);
2663             }
2664
2665             // Scroll right if the obj is beyond the right border and the cursor is
2666             // near the border.
2667             if ( right > clientW && toRight < thresh ) {
2668                 window.scrollTo(sl + scrAmt, st);
2669             }
2670
2671             // Scroll left if the window has been scrolled to the right and the obj
2672             // extends past the left border
2673             if ( x < sl && sl > 0 && x - sl < thresh ) {
2674                 window.scrollTo(sl - scrAmt, st);
2675             }
2676         }
2677     },
2678
2679     /**
2680      * Finds the location the element should be placed if we want to move
2681      * it to where the mouse location less the click offset would place us.
2682      * @method getTargetCoord
2683      * @param {int} iPageX the X coordinate of the click
2684      * @param {int} iPageY the Y coordinate of the click
2685      * @return an object that contains the coordinates (Object.x and Object.y)
2686      * @private
2687      */
2688     getTargetCoord: function(iPageX, iPageY) {
2689
2690
2691         var x = iPageX - this.deltaX;
2692         var y = iPageY - this.deltaY;
2693
2694         if (this.constrainX) {
2695             if (x < this.minX) { x = this.minX; }
2696             if (x > this.maxX) { x = this.maxX; }
2697         }
2698
2699         if (this.constrainY) {
2700             if (y < this.minY) { y = this.minY; }
2701             if (y > this.maxY) { y = this.maxY; }
2702         }
2703
2704         x = this.getTick(x, this.xTicks);
2705         y = this.getTick(y, this.yTicks);
2706
2707
2708         return {x:x, y:y};
2709     },
2710
2711     <div id="method-Ext.dd.DD-applyConfig"></div>/**
2712      * Sets up config options specific to this class. Overrides
2713      * Ext.dd.DragDrop, but all versions of this method through the
2714      * inheritance chain are called
2715      */
2716     applyConfig: function() {
2717         Ext.dd.DD.superclass.applyConfig.call(this);
2718         this.scroll = (this.config.scroll !== false);
2719     },
2720
2721     <div id="method-Ext.dd.DD-b4MouseDown"></div>/**
2722      * Event that fires prior to the onMouseDown event.  Overrides
2723      * Ext.dd.DragDrop.
2724      */
2725     b4MouseDown: function(e) {
2726         // this.resetConstraints();
2727         this.autoOffset(e.getPageX(),
2728                             e.getPageY());
2729     },
2730
2731     <div id="method-Ext.dd.DD-b4Drag"></div>/**
2732      * Event that fires prior to the onDrag event.  Overrides
2733      * Ext.dd.DragDrop.
2734      */
2735     b4Drag: function(e) {
2736         this.setDragElPos(e.getPageX(),
2737                             e.getPageY());
2738     },
2739
2740     toString: function() {
2741         return ("DD " + this.id);
2742     }
2743
2744     //////////////////////////////////////////////////////////////////////////
2745     // Debugging ygDragDrop events that can be overridden
2746     //////////////////////////////////////////////////////////////////////////
2747     /*
2748     startDrag: function(x, y) {
2749     },
2750
2751     onDrag: function(e) {
2752     },
2753
2754     onDragEnter: function(e, id) {
2755     },
2756
2757     onDragOver: function(e, id) {
2758     },
2759
2760     onDragOut: function(e, id) {
2761     },
2762
2763     onDragDrop: function(e, id) {
2764     },
2765
2766     endDrag: function(e) {
2767     }
2768
2769     */
2770
2771 });
2772 <div id="cls-Ext.dd.DDProxy"></div>/**
2773  * @class Ext.dd.DDProxy
2774  * A DragDrop implementation that inserts an empty, bordered div into
2775  * the document that follows the cursor during drag operations.  At the time of
2776  * the click, the frame div is resized to the dimensions of the linked html
2777  * element, and moved to the exact location of the linked element.
2778  *
2779  * References to the "frame" element refer to the single proxy element that
2780  * was created to be dragged in place of all DDProxy elements on the
2781  * page.
2782  *
2783  * @extends Ext.dd.DD
2784  * @constructor
2785  * @param {String} id the id of the linked html element
2786  * @param {String} sGroup the group of related DragDrop objects
2787  * @param {object} config an object containing configurable attributes
2788  *                Valid properties for DDProxy in addition to those in DragDrop:
2789  *                   resizeFrame, centerFrame, dragElId
2790  */
2791 Ext.dd.DDProxy = function(id, sGroup, config) {
2792     if (id) {
2793         this.init(id, sGroup, config);
2794         this.initFrame();
2795     }
2796 };
2797
2798 <div id="prop-Ext.dd.DDProxy-Ext.dd.DDProxy.dragElId"></div>/**
2799  * The default drag frame div id
2800  * @property Ext.dd.DDProxy.dragElId
2801  * @type String
2802  * @static
2803  */
2804 Ext.dd.DDProxy.dragElId = "ygddfdiv";
2805
2806 Ext.extend(Ext.dd.DDProxy, Ext.dd.DD, {
2807
2808     <div id="prop-Ext.dd.DDProxy-resizeFrame"></div>/**
2809      * By default we resize the drag frame to be the same size as the element
2810      * we want to drag (this is to get the frame effect).  We can turn it off
2811      * if we want a different behavior.
2812      * @property resizeFrame
2813      * @type boolean
2814      */
2815     resizeFrame: true,
2816
2817     <div id="prop-Ext.dd.DDProxy-centerFrame"></div>/**
2818      * By default the frame is positioned exactly where the drag element is, so
2819      * we use the cursor offset provided by Ext.dd.DD.  Another option that works only if
2820      * you do not have constraints on the obj is to have the drag frame centered
2821      * around the cursor.  Set centerFrame to true for this effect.
2822      * @property centerFrame
2823      * @type boolean
2824      */
2825     centerFrame: false,
2826
2827     <div id="method-Ext.dd.DDProxy-createFrame"></div>/**
2828      * Creates the proxy element if it does not yet exist
2829      * @method createFrame
2830      */
2831     createFrame: function() {
2832         var self = this;
2833         var body = document.body;
2834
2835         if (!body || !body.firstChild) {
2836             setTimeout( function() { self.createFrame(); }, 50 );
2837             return;
2838         }
2839
2840         var div = this.getDragEl();
2841
2842         if (!div) {
2843             div    = document.createElement("div");
2844             div.id = this.dragElId;
2845             var s  = div.style;
2846
2847             s.position   = "absolute";
2848             s.visibility = "hidden";
2849             s.cursor     = "move";
2850             s.border     = "2px solid #aaa";
2851             s.zIndex     = 999;
2852
2853             // appendChild can blow up IE if invoked prior to the window load event
2854             // while rendering a table.  It is possible there are other scenarios
2855             // that would cause this to happen as well.
2856             body.insertBefore(div, body.firstChild);
2857         }
2858     },
2859
2860     <div id="method-Ext.dd.DDProxy-initFrame"></div>/**
2861      * Initialization for the drag frame element.  Must be called in the
2862      * constructor of all subclasses
2863      * @method initFrame
2864      */
2865     initFrame: function() {
2866         this.createFrame();
2867     },
2868
2869     applyConfig: function() {
2870         Ext.dd.DDProxy.superclass.applyConfig.call(this);
2871
2872         this.resizeFrame = (this.config.resizeFrame !== false);
2873         this.centerFrame = (this.config.centerFrame);
2874         this.setDragElId(this.config.dragElId || Ext.dd.DDProxy.dragElId);
2875     },
2876
2877     /**
2878      * Resizes the drag frame to the dimensions of the clicked object, positions
2879      * it over the object, and finally displays it
2880      * @method showFrame
2881      * @param {int} iPageX X click position
2882      * @param {int} iPageY Y click position
2883      * @private
2884      */
2885     showFrame: function(iPageX, iPageY) {
2886         var el = this.getEl();
2887         var dragEl = this.getDragEl();
2888         var s = dragEl.style;
2889
2890         this._resizeProxy();
2891
2892         if (this.centerFrame) {
2893             this.setDelta( Math.round(parseInt(s.width,  10)/2),
2894                            Math.round(parseInt(s.height, 10)/2) );
2895         }
2896
2897         this.setDragElPos(iPageX, iPageY);
2898
2899         Ext.fly(dragEl).show();
2900     },
2901
2902     /**
2903      * The proxy is automatically resized to the dimensions of the linked
2904      * element when a drag is initiated, unless resizeFrame is set to false
2905      * @method _resizeProxy
2906      * @private
2907      */
2908     _resizeProxy: function() {
2909         if (this.resizeFrame) {
2910             var el = this.getEl();
2911             Ext.fly(this.getDragEl()).setSize(el.offsetWidth, el.offsetHeight);
2912         }
2913     },
2914
2915     // overrides Ext.dd.DragDrop
2916     b4MouseDown: function(e) {
2917         var x = e.getPageX();
2918         var y = e.getPageY();
2919         this.autoOffset(x, y);
2920         this.setDragElPos(x, y);
2921     },
2922
2923     // overrides Ext.dd.DragDrop
2924     b4StartDrag: function(x, y) {
2925         // show the drag frame
2926         this.showFrame(x, y);
2927     },
2928
2929     // overrides Ext.dd.DragDrop
2930     b4EndDrag: function(e) {
2931         Ext.fly(this.getDragEl()).hide();
2932     },
2933
2934     // overrides Ext.dd.DragDrop
2935     // By default we try to move the element to the last location of the frame.
2936     // This is so that the default behavior mirrors that of Ext.dd.DD.
2937     endDrag: function(e) {
2938
2939         var lel = this.getEl();
2940         var del = this.getDragEl();
2941
2942         // Show the drag frame briefly so we can get its position
2943         del.style.visibility = "";
2944
2945         this.beforeMove();
2946         // Hide the linked element before the move to get around a Safari
2947         // rendering bug.
2948         lel.style.visibility = "hidden";
2949         Ext.dd.DDM.moveToEl(lel, del);
2950         del.style.visibility = "hidden";
2951         lel.style.visibility = "";
2952
2953         this.afterDrag();
2954     },
2955
2956     beforeMove : function(){
2957
2958     },
2959
2960     afterDrag : function(){
2961
2962     },
2963
2964     toString: function() {
2965         return ("DDProxy " + this.id);
2966     }
2967
2968 });
2969 <div id="cls-Ext.dd.DDTarget"></div>/**
2970  * @class Ext.dd.DDTarget
2971  * A DragDrop implementation that does not move, but can be a drop
2972  * target.  You would get the same result by simply omitting implementation
2973  * for the event callbacks, but this way we reduce the processing cost of the
2974  * event listener and the callbacks.
2975  * @extends Ext.dd.DragDrop
2976  * @constructor
2977  * @param {String} id the id of the element that is a drop target
2978  * @param {String} sGroup the group of related DragDrop objects
2979  * @param {object} config an object containing configurable attributes
2980  *                 Valid properties for DDTarget in addition to those in
2981  *                 DragDrop:
2982  *                    none
2983  */
2984 Ext.dd.DDTarget = function(id, sGroup, config) {
2985     if (id) {
2986         this.initTarget(id, sGroup, config);
2987     }
2988 };
2989
2990 // Ext.dd.DDTarget.prototype = new Ext.dd.DragDrop();
2991 Ext.extend(Ext.dd.DDTarget, Ext.dd.DragDrop, {
2992     <div id="method-Ext.dd.DDTarget-getDragEl"></div>/**
2993      * @hide
2994      * Overridden and disabled. A DDTarget does not support being dragged.
2995      * @method
2996      */
2997     getDragEl: Ext.emptyFn,
2998     <div id="method-Ext.dd.DDTarget-isValidHandleChild"></div>/**
2999      * @hide
3000      * Overridden and disabled. A DDTarget does not support being dragged.
3001      * @method
3002      */
3003     isValidHandleChild: Ext.emptyFn,
3004     <div id="method-Ext.dd.DDTarget-startDrag"></div>/**
3005      * @hide
3006      * Overridden and disabled. A DDTarget does not support being dragged.
3007      * @method
3008      */
3009     startDrag: Ext.emptyFn,
3010     <div id="method-Ext.dd.DDTarget-endDrag"></div>/**
3011      * @hide
3012      * Overridden and disabled. A DDTarget does not support being dragged.
3013      * @method
3014      */
3015     endDrag: Ext.emptyFn,
3016     <div id="method-Ext.dd.DDTarget-onDrag"></div>/**
3017      * @hide
3018      * Overridden and disabled. A DDTarget does not support being dragged.
3019      * @method
3020      */
3021     onDrag: Ext.emptyFn,
3022     <div id="method-Ext.dd.DDTarget-onDragDrop"></div>/**
3023      * @hide
3024      * Overridden and disabled. A DDTarget does not support being dragged.
3025      * @method
3026      */
3027     onDragDrop: Ext.emptyFn,
3028     <div id="method-Ext.dd.DDTarget-onDragEnter"></div>/**
3029      * @hide
3030      * Overridden and disabled. A DDTarget does not support being dragged.
3031      * @method
3032      */
3033     onDragEnter: Ext.emptyFn,
3034     <div id="method-Ext.dd.DDTarget-onDragOut"></div>/**
3035      * @hide
3036      * Overridden and disabled. A DDTarget does not support being dragged.
3037      * @method
3038      */
3039     onDragOut: Ext.emptyFn,
3040     <div id="method-Ext.dd.DDTarget-onDragOver"></div>/**
3041      * @hide
3042      * Overridden and disabled. A DDTarget does not support being dragged.
3043      * @method
3044      */
3045     onDragOver: Ext.emptyFn,
3046     <div id="method-Ext.dd.DDTarget-onInvalidDrop"></div>/**
3047      * @hide
3048      * Overridden and disabled. A DDTarget does not support being dragged.
3049      * @method
3050      */
3051     onInvalidDrop: Ext.emptyFn,
3052     <div id="method-Ext.dd.DDTarget-onMouseDown"></div>/**
3053      * @hide
3054      * Overridden and disabled. A DDTarget does not support being dragged.
3055      * @method
3056      */
3057     onMouseDown: Ext.emptyFn,
3058     <div id="method-Ext.dd.DDTarget-onMouseUp"></div>/**
3059      * @hide
3060      * Overridden and disabled. A DDTarget does not support being dragged.
3061      * @method
3062      */
3063     onMouseUp: Ext.emptyFn,
3064     <div id="method-Ext.dd.DDTarget-setXConstraint"></div>/**
3065      * @hide
3066      * Overridden and disabled. A DDTarget does not support being dragged.
3067      * @method
3068      */
3069     setXConstraint: Ext.emptyFn,
3070     <div id="method-Ext.dd.DDTarget-setYConstraint"></div>/**
3071      * @hide
3072      * Overridden and disabled. A DDTarget does not support being dragged.
3073      * @method
3074      */
3075     setYConstraint: Ext.emptyFn,
3076     <div id="method-Ext.dd.DDTarget-resetConstraints"></div>/**
3077      * @hide
3078      * Overridden and disabled. A DDTarget does not support being dragged.
3079      * @method
3080      */
3081     resetConstraints: Ext.emptyFn,
3082     <div id="method-Ext.dd.DDTarget-clearConstraints"></div>/**
3083      * @hide
3084      * Overridden and disabled. A DDTarget does not support being dragged.
3085      * @method
3086      */
3087     clearConstraints: Ext.emptyFn,
3088     <div id="method-Ext.dd.DDTarget-clearTicks"></div>/**
3089      * @hide
3090      * Overridden and disabled. A DDTarget does not support being dragged.
3091      * @method
3092      */
3093     clearTicks: Ext.emptyFn,
3094     <div id="method-Ext.dd.DDTarget-setInitPosition"></div>/**
3095      * @hide
3096      * Overridden and disabled. A DDTarget does not support being dragged.
3097      * @method
3098      */
3099     setInitPosition: Ext.emptyFn,
3100     <div id="method-Ext.dd.DDTarget-setDragElId"></div>/**
3101      * @hide
3102      * Overridden and disabled. A DDTarget does not support being dragged.
3103      * @method
3104      */
3105     setDragElId: Ext.emptyFn,
3106     <div id="method-Ext.dd.DDTarget-setHandleElId"></div>/**
3107      * @hide
3108      * Overridden and disabled. A DDTarget does not support being dragged.
3109      * @method
3110      */
3111     setHandleElId: Ext.emptyFn,
3112     <div id="method-Ext.dd.DDTarget-setOuterHandleElId"></div>/**
3113      * @hide
3114      * Overridden and disabled. A DDTarget does not support being dragged.
3115      * @method
3116      */
3117     setOuterHandleElId: Ext.emptyFn,
3118     <div id="method-Ext.dd.DDTarget-addInvalidHandleClass"></div>/**
3119      * @hide
3120      * Overridden and disabled. A DDTarget does not support being dragged.
3121      * @method
3122      */
3123     addInvalidHandleClass: Ext.emptyFn,
3124     <div id="method-Ext.dd.DDTarget-addInvalidHandleId"></div>/**
3125      * @hide
3126      * Overridden and disabled. A DDTarget does not support being dragged.
3127      * @method
3128      */
3129     addInvalidHandleId: Ext.emptyFn,
3130     <div id="method-Ext.dd.DDTarget-addInvalidHandleType"></div>/**
3131      * @hide
3132      * Overridden and disabled. A DDTarget does not support being dragged.
3133      * @method
3134      */
3135     addInvalidHandleType: Ext.emptyFn,
3136     <div id="method-Ext.dd.DDTarget-removeInvalidHandleClass"></div>/**
3137      * @hide
3138      * Overridden and disabled. A DDTarget does not support being dragged.
3139      * @method
3140      */
3141     removeInvalidHandleClass: Ext.emptyFn,
3142     <div id="method-Ext.dd.DDTarget-removeInvalidHandleId"></div>/**
3143      * @hide
3144      * Overridden and disabled. A DDTarget does not support being dragged.
3145      * @method
3146      */
3147     removeInvalidHandleId: Ext.emptyFn,
3148     <div id="method-Ext.dd.DDTarget-removeInvalidHandleType"></div>/**
3149      * @hide
3150      * Overridden and disabled. A DDTarget does not support being dragged.
3151      * @method
3152      */
3153     removeInvalidHandleType: Ext.emptyFn,
3154
3155     toString: function() {
3156         return ("DDTarget " + this.id);
3157     }
3158 });</pre>    \r
3159 </body>\r
3160 </html>