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