Properties Methods Events Direct Link

# Class Ext.dd.DragDropMgr

Package: | Ext.dd
Defined In: | DDCore.js
Class: | DragDropMgr
Extends: | Object

DragDropMgr is a singleton that tracks the element interaction for all DragDrop items in the window. Generally, you will not call this class directly, but it does have helper methods that could be useful in your DragDrop implementations.
This class is a singleton and cannot be created directly.

## Public Properties

Property | Defined By
--- | ---
| INTERSECT : int <static> In intersect mode, drag and drop interactio nis defined by the overlap of two or more drag and drop ob... <static> In intersect mode, drag and drop interactio nis defined by the overlap of two or more drag and drop objects. | DragDropMgr
| POINT : int <static> In point mode, drag and drop interaction is defined by the location of the cursor during the drag/drop | DragDropMgr
| clickPixelThresh : int <static> The number of pixels that the mouse needs to move after the mousedown before the drag is initiated. D... <static> The number of pixels that the mouse needs to move after the mousedown before the drag is initiated. Default=3; | DragDropMgr
| clickTimeThresh : int <static> The number of milliseconds after the mousedown event to initiate the drag if we don't get a mouseup ev... <static> The number of milliseconds after the mousedown event to initiate the drag if we don't get a mouseup event. Default=1000 | DragDropMgr
| css : Object A reference to the style property | DragDropMgr
| el : Object The element | DragDropMgr
| id : Object The element id | DragDropMgr
| mode : int <static> The current drag and drop mode. Default: POINT | DragDropMgr
| preventDefault : boolean <static> Flag to determine if we should prevent the default behavior of the events we define. By default this i... <static> Flag to determine if we should prevent the default behavior of the events we define. By default this is true, but this can be set to false if you need the default behavior (not recommended) | DragDropMgr
| stopPropagation : boolean <static> Flag to determine if we should stop the propagation of the events we generate. This is true by default... <static> Flag to determine if we should stop the propagation of the events we generate. This is true by default but you may want to set it to false if the html element contains other features that require the mouse click. | DragDropMgr
| useCache : boolean <static> Set useCache to false if you want to force object the lookup of each drag and drop linked element cons... <static> Set useCache to false if you want to force object the lookup of each drag and drop linked element constantly during a drag. | DragDropMgr

## Public Methods

Method | Defined By
--- | ---

getBestMatch( `DragDrop[] dds` ) : DragDrop
<static> Helper function for getting the best match from the list of drag and drop objects returned by the drag...
<static> Helper function for getting the best match from the list of drag and drop objects returned by the drag and drop events when we are in INTERSECT mode. It returns either the first object that the cursor is over, or the object that has the greatest overlap with the dragged element.
Parameters:

- `dds` : DragDrop[]
  The array of drag and drop objects targeted

Returns:

- `DragDrop`
  The best single match

DragDropMgr

getCss( `String id` ) : Object
Deprecated. <static> Returns the style property for the DOM element (i.e., document.getElById(id).style)
Deprecated. <static> Returns the style property for the DOM element (i.e., document.getElById(id).style)
Parameters:

- `id` : String
  the id of the elment to get

Returns:

- `Object`
  The style property of the element

DragDropMgr

getDDById( `String id` ) : DragDrop
<static> Returns the DragDrop instance for a given id
<static> Returns the DragDrop instance for a given id
Parameters:

- `id` : String
  the id of the DragDrop object

Returns:

- `DragDrop`
  the drag drop object, null if it is not found

DragDropMgr

getElement( `String id` ) : Object
Deprecated. <static> Returns the actual DOM element
Deprecated. <static> Returns the actual DOM element
Parameters:

- `id` : String
  the id of the elment to get

Returns:

- `Object`
  The element

DragDropMgr

getLocation( `DragDrop oDD` ) : Ext.lib.Region
<static> Returns a Region object containing the drag and drop element's position and size, including the paddin...
<static> Returns a Region object containing the drag and drop element's position and size, including the padding configured for it
Parameters:

- `oDD` : DragDrop
  the drag and drop object to get the location for

Returns:

- `Ext.lib.Region`
  a Region object representing the total area the element occupies, including any padding the instance is configured for.

DragDropMgr

getPosX( `el the` ) : int
Deprecated. <static> Returns the X position of an html element
Deprecated. <static> Returns the X position of an html element
Parameters:

- `the` : el
  element for which to get the position

Returns:

- `int`
  the X coordinate @for DragDropMgr

DragDropMgr

getPosY( `el the` ) : int
Deprecated. <static> Returns the Y position of an html element
Deprecated. <static> Returns the Y position of an html element
Parameters:

- `the` : el
  element for which to get the position

Returns:

- `int`
  the Y coordinate

DragDropMgr

getRelated( `DragDrop p_oDD`, `boolean bTargetsOnly` ) : DragDrop[]
<static> Returns the drag and drop instances that are in all groups the passed in instance belongs to.
<static> Returns the drag and drop instances that are in all groups the passed in instance belongs to.
Parameters:

- `p_oDD` : DragDrop
  the obj to get related data for
- `bTargetsOnly` : boolean
  if true, only return targetable objs

Returns:

- `DragDrop[]`
  the related instances

DragDropMgr

getScrollLeft() : int
<static> Gets the scrollLeft
<static> Gets the scrollLeft
Parameters:

- None.

Returns:

- `int`
  the document's scrollTop

DragDropMgr

getScrollTop() : int
<static> Gets the scrollTop
<static> Gets the scrollTop
Parameters:

- None.

Returns:

- `int`
  the document's scrollTop

DragDropMgr

getStyle( `HTMLElement el`, `string styleProp` ) : string
Deprecated. <static> Returns the specified element style property
Deprecated. <static> Returns the specified element style property
Parameters:

- `el` : HTMLElement
  the element
- `styleProp` : string
  the style property

Returns:

- `string`
  The value of the style property

DragDropMgr

handleWasClicked( `node the` ) : void
<static> Recursively searches the immediate parent and all child nodes for the handle element in order to deter...
<static> Recursively searches the immediate parent and all child nodes for the handle element in order to determine wheter or not it was clicked.
Parameters:

- `the` : node
  html element to inspect

Returns:

- `void`

DragDropMgr

isDragDrop( `String id` ) : boolean
<static> Utility function to determine if a given element has been registered as a drag drop item.
<static> Utility function to determine if a given element has been registered as a drag drop item.
Parameters:

- `id` : String
  the element id to check

Returns:

- `boolean`
  true if this element is a DragDrop item, false otherwise

DragDropMgr

isHandle( `String id` ) : boolean
<static> Utility function to determine if a given element has been registered as a drag drop handle for the giv...
<static> Utility function to determine if a given element has been registered as a drag drop handle for the given Drag Drop object.
Parameters:

- `id` : String
  the element id to check

Returns:

- `boolean`
  true if this element is a DragDrop handle, false otherwise

DragDropMgr

isLegalTarget( `DragDrop the`, `DragDrop the` ) : boolean
<static> Returns true if the specified dd target is a legal target for the specifice drag obj
<static> Returns true if the specified dd target is a legal target for the specifice drag obj
Parameters:

- `the` : DragDrop
  drag obj
- `the` : DragDrop
  target

Returns:

- `boolean`
  true if the target is a legal target for the dd obj

DragDropMgr

isLocked() : boolean
<static> Is drag and drop locked?
<static> Is drag and drop locked?
Parameters:

- None.

Returns:

- `boolean`
  True if drag and drop is locked, false otherwise.

DragDropMgr

isTypeOfDD( `Object the` ) : boolean
<static> My goal is to be able to transparently determine if an object is typeof DragDrop, and the exact subcla...
<static> My goal is to be able to transparently determine if an object is typeof DragDrop, and the exact subclass of DragDrop. typeof returns "object", oDD.constructor.toString() always returns "DragDrop" and not the name of the subclass. So for now it just evaluates a well-known variable in DragDrop.
Parameters:

- `the` : Object
  object to evaluate

Returns:

- `boolean`
  true if typeof oDD = DragDrop

DragDropMgr

lock() : void
<static> Lock all drag and drop functionality
<static> Lock all drag and drop functionality
Parameters:

- None.

Returns:

- `void`

DragDropMgr

moveToEl( `HTMLElement moveEl`, `HTMLElement targetEl` ) : void
<static> Sets the x/y position of an element to the location of the target element.
<static> Sets the x/y position of an element to the location of the target element.
Parameters:

- `moveEl` : HTMLElement
  The element to move
- `targetEl` : HTMLElement
  The position reference element

Returns:

- `void`

DragDropMgr

numericSort() : void
<static> Numeric array sort function
<static> Numeric array sort function
Parameters:

- None.

Returns:

- `void`

DragDropMgr

refreshCache( `Object groups` ) : void
<static> Refreshes the cache of the top-left and bottom-right points of the drag and drop objects in the specif...
<static> Refreshes the cache of the top-left and bottom-right points of the drag and drop objects in the specified group(s). This is in the format that is stored in the drag and drop instance, so typical usage is: `Ext.dd.DragDropMgr.refreshCache(ddinstance.groups);` Alternatively: `Ext.dd.DragDropMgr.refreshCache({group1:true, group2:true});` @TODO this really should be an indexed array. Alternatively this method could accept both.
Parameters:

- `groups` : Object
  an associative array of groups to refresh

Returns:

- `void`

DragDropMgr

regDragDrop( `DragDrop oDD`, `String sGroup` ) : void
<static> Each DragDrop instance must be registered with the DragDropMgr. This is executed in DragDrop.init()
<static> Each DragDrop instance must be registered with the DragDropMgr. This is executed in DragDrop.init()
Parameters:

- `oDD` : DragDrop
  the DragDrop object to register
- `sGroup` : String
  the name of the group this element belongs to

Returns:

- `void`

DragDropMgr

regHandle( `String sDDId`, `String sHandleId` ) : void
<static> Each DragDrop handle element must be registered. This is done automatically when executing DragDrop.s...
<static> Each DragDrop handle element must be registered. This is done automatically when executing DragDrop.setHandleElId()
Parameters:

- `sDDId` : String
  the DragDrop id this element is a handle for
- `sHandleId` : String
  the id of the element that is the drag handle

Returns:

- `void`

DragDropMgr

startDrag( `x {int}`, `y {int}` ) : void
<static> Fired when either the drag pixel threshol or the mousedown hold time threshold has been met.
<static> Fired when either the drag pixel threshol or the mousedown hold time threshold has been met.
Parameters:

- `{int}` : x
  the X position of the original mousedown
- `{int}` : y
  the Y position of the original mousedown

Returns:

- `void`

DragDropMgr

stopEvent( `Event e` ) : void
<static> Utility to stop event propagation and event default, if these features are turned on.
<static> Utility to stop event propagation and event default, if these features are turned on.
Parameters:

- `e` : Event
  the event as returned by this.getEvent()

Returns:

- `void`

DragDropMgr

swapNode( `n1 the`, `n2 the` ) : void
<static> Swap two nodes. In IE, we use the native method, for others we emulate the IE behavior
<static> Swap two nodes. In IE, we use the native method, for others we emulate the IE behavior
Parameters:

- `the` : n1
  first node to swap
- `the` : n2
  other node to swap

Returns:

- `void`

DragDropMgr

unlock() : void
<static> Unlock all drag and drop functionality
<static> Unlock all drag and drop functionality
Parameters:

- None.

Returns:

- `void`

DragDropMgr

verifyEl( `HTMLElement el` ) : boolean
<static> This checks to make sure an element exists and is in the DOM. The main purpose is to handle cases whe...
<static> This checks to make sure an element exists and is in the DOM. The main purpose is to handle cases where innerHTML is used to remove drag and drop objects from the DOM. IE provides an 'unspecified error' when trying to access the offsetParent of such an element
Parameters:

- `el` : HTMLElement
  the element to check

Returns:

- `boolean`
  true if the element looks usable

DragDropMgr

## Public Events

This class has no public events.