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.
|
INTERSECT : int |
DragDropMgr |
<static> In intersect mode, drag and drop interactio nis defined by the
overlap of two or more drag and drop ob... |
|
POINT : int |
DragDropMgr |
<static> In point mode, drag and drop interaction is defined by the
location of the cursor during the drag/drop |
|
clickPixelThresh : int |
DragDropMgr |
<static> The number of pixels that the mouse needs to move after the
mousedown before the drag is initiated. D... |
|
clickTimeThresh : int |
DragDropMgr |
<static> The number of milliseconds after the mousedown event to initiate the
drag if we don't get a mouseup ev... |
|
css : Object |
DragDropMgr |
A reference to the style property |
|
el : Object |
DragDropMgr |
The element |
|
id : Object |
DragDropMgr |
The element id |
|
mode : int |
DragDropMgr |
<static> The current drag and drop mode. Default: POINT |
|
preventDefault : boolean |
DragDropMgr |
<static> Flag to determine if we should prevent the default behavior of the
events we define. By default this i... |
|
stopPropagation : boolean |
DragDropMgr |
<static> Flag to determine if we should stop the propagation of the events
we generate. This is true by default... |
|
useCache : boolean |
DragDropMgr |
<static> Set useCache to false if you want to force object the lookup of each
drag and drop linked element cons... |
|
getBestMatch( DragDrop[] dds ) : DragDrop |
DragDropMgr |
<static> Helper function for getting the best match from the list of drag
and drop objects returned by the drag... |
|
getCss( String id ) : Object |
DragDropMgr |
Deprecated. <static> Returns the style property for the DOM element (i.e.,
document.getElById(id).style) |
|
getDDById( String id ) : DragDrop |
DragDropMgr |
<static> Returns the DragDrop instance for a given id |
|
getElement( String id ) : Object |
DragDropMgr |
Deprecated. <static> Returns the actual DOM element |
|
getLocation( DragDrop oDD ) : Ext.lib.Region |
DragDropMgr |
<static> Returns a Region object containing the drag and drop element's position
and size, including the paddin... |
|
getPosX( el the ) : int |
DragDropMgr |
Deprecated. <static> Returns the X position of an html element |
|
getPosY( el the ) : int |
DragDropMgr |
Deprecated. <static> Returns the Y position of an html element |
|
getRelated( DragDrop p_oDD , boolean bTargetsOnly ) : DragDrop[] |
DragDropMgr |
<static> Returns the drag and drop instances that are in all groups the
passed in instance belongs to. |
|
getScrollLeft() : int |
DragDropMgr |
<static> Gets the scrollLeft |
|
getScrollTop() : int |
DragDropMgr |
<static> Gets the scrollTop |
|
getStyle( HTMLElement el , string styleProp ) : string |
DragDropMgr |
Deprecated. <static> Returns the specified element style property |
|
handleWasClicked( node the ) : void |
DragDropMgr |
<static> Recursively searches the immediate parent and all child nodes for
the handle element in order to deter... |
|
isDragDrop( String id ) : boolean |
DragDropMgr |
<static> Utility function to determine if a given element has been
registered as a drag drop item. |
|
isHandle( String id ) : boolean |
DragDropMgr |
<static> Utility function to determine if a given element has been
registered as a drag drop handle for the giv... |
|
isLegalTarget( DragDrop the , DragDrop the ) : boolean |
DragDropMgr |
<static> Returns true if the specified dd target is a legal target for
the specifice drag obj |
|
isLocked() : boolean |
DragDropMgr |
<static> Is drag and drop locked? |
|
isTypeOfDD( Object the ) : boolean |
DragDropMgr |
<static> My goal is to be able to transparently determine if an object is
typeof DragDrop, and the exact subcla... |
|
lock() : void |
DragDropMgr |
<static> Lock all drag and drop functionality |
|
moveToEl( HTMLElement moveEl , HTMLElement targetEl ) : void |
DragDropMgr |
<static> Sets the x/y position of an element to the location of the
target element. |
|
numericSort() : void |
DragDropMgr |
<static> Numeric array sort function |
|
refreshCache( Object groups ) : void |
DragDropMgr |
<static> Refreshes the cache of the top-left and bottom-right points of the
drag and drop objects in the specif... |
|
regDragDrop( DragDrop oDD , String sGroup ) : void |
DragDropMgr |
<static> Each DragDrop instance must be registered with the DragDropMgr.
This is executed in DragDrop.init() |
|
regHandle( String sDDId , String sHandleId ) : void |
DragDropMgr |
<static> Each DragDrop handle element must be registered. This is done
automatically when executing DragDrop.s... |
|
startDrag( x {int} , y {int} ) : void |
DragDropMgr |
<static> Fired when either the drag pixel threshol or the mousedown hold
time threshold has been met. |
|
stopEvent( Event e ) : void |
DragDropMgr |
<static> Utility to stop event propagation and event default, if these
features are turned on. |
|
swapNode( n1 the , n2 the ) : void |
DragDropMgr |
<static> Swap two nodes. In IE, we use the native method, for others we
emulate the IE behavior |
|
unlock() : void |
DragDropMgr |
<static> Unlock all drag and drop functionality |
|
verifyEl( HTMLElement el ) : boolean |
DragDropMgr |
<static> This checks to make sure an element exists and is in the DOM. The
main purpose is to handle cases whe... |
This class has no public events.
INTERSECT
public int INTERSECT
<static> In intersect mode, drag and drop interactio nis defined by the
overlap of two or more drag and drop objects.
This property is defined by DragDropMgr.
POINT
public int POINT
<static> In point mode, drag and drop interaction is defined by the
location of the cursor during the drag/drop
This property is defined by DragDropMgr.
clickPixelThresh
public int clickPixelThresh
<static> The number of pixels that the mouse needs to move after the
mousedown before the drag is initiated. Default=3;
This property is defined by DragDropMgr.
clickTimeThresh
public int clickTimeThresh
<static> The number of milliseconds after the mousedown event to initiate the
drag if we don't get a mouseup event. Default=1000
This property is defined by DragDropMgr.
css
public Object css
A reference to the style property
This property is defined by DragDropMgr.
el
public Object el
The element
This property is defined by DragDropMgr.
id
public Object id
The element id
This property is defined by DragDropMgr.
mode
public int mode
<static> The current drag and drop mode. Default: POINT
This property is defined by DragDropMgr.
preventDefault
public boolean preventDefault
<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)
This property is defined by DragDropMgr.
stopPropagation
public boolean stopPropagation
<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.
This property is defined by DragDropMgr.
useCache
public boolean useCache
<static> Set useCache to false if you want to force object the lookup of each
drag and drop linked element constantly during a drag.
This property is defined by DragDropMgr.
getBestMatch
public function getBestMatch( DragDrop[] dds
)
<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:
Returns:
DragDrop
The best single match
This method is defined by DragDropMgr.
getCss
public function getCss( String id
)
Deprecated. <static> Returns the style property for the DOM element (i.e.,
document.getElById(id).style)
This method is defined by DragDropMgr.
getDDById
public function getDDById( String id
)
<static> Returns the DragDrop instance for a given id
This method is defined by DragDropMgr.
getElement
public function getElement( String id
)
Deprecated. <static> Returns the actual DOM element
This method is defined by DragDropMgr.
getLocation
public function getLocation( DragDrop oDD
)
<static> Returns a Region object containing the drag and drop element's position
and size, including the padding configured for it
This method is defined by DragDropMgr.
getPosX
public function getPosX( el the
)
Deprecated. <static> Returns the X position of an html element
This method is defined by DragDropMgr.
getPosY
public function getPosY( el the
)
Deprecated. <static> Returns the Y position of an html element
This method is defined by DragDropMgr.
getRelated
public function getRelated( DragDrop p_oDD
, boolean bTargetsOnly
)
<static> Returns the drag and drop instances that are in all groups the
passed in instance belongs to.
Parameters:
Returns:
DragDrop[]
the related instances
This method is defined by DragDropMgr.
getScrollLeft
public function getScrollLeft()
<static> Gets the scrollLeft
Parameters:
Returns:
int
the document's scrollTop
This method is defined by DragDropMgr.
getScrollTop
public function getScrollTop()
<static> Gets the scrollTop
Parameters:
Returns:
int
the document's scrollTop
This method is defined by DragDropMgr.
getStyle
public function getStyle( HTMLElement el
, string styleProp
)
Deprecated. <static> Returns the specified element style property
Parameters:
el
: HTMLElementthe element
styleProp
: stringthe style property
Returns:
This method is defined by DragDropMgr.
handleWasClicked
public function handleWasClicked( node the
)
<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
: nodehtml element to inspect
Returns:
This method is defined by DragDropMgr.
isDragDrop
public function isDragDrop( String id
)
<static> Utility function to determine if a given element has been
registered as a drag drop item.
Parameters:
id
: Stringthe element id to check
Returns:
This method is defined by DragDropMgr.
isHandle
public function isHandle( String id
)
<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
: Stringthe element id to check
Returns:
This method is defined by DragDropMgr.
isLegalTarget
public function isLegalTarget( DragDrop the
, DragDrop the
)
<static> Returns true if the specified dd target is a legal target for
the specifice drag obj
Parameters:
the
: DragDropdrag obj
the
: DragDroptarget
Returns:
This method is defined by DragDropMgr.
isLocked
public function isLocked()
<static> Is drag and drop locked?
This method is defined by DragDropMgr.
isTypeOfDD
public function isTypeOfDD( Object the
)
<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
: Objectobject to evaluate
Returns:
This method is defined by DragDropMgr.
lock
public function lock()
<static> Lock all drag and drop functionality
This method is defined by DragDropMgr.
moveToEl
public function moveToEl( HTMLElement moveEl
, HTMLElement targetEl
)
<static> Sets the x/y position of an element to the location of the
target element.
This method is defined by DragDropMgr.
numericSort
public function numericSort()
<static> Numeric array sort function
This method is defined by DragDropMgr.
refreshCache
public function refreshCache( Object groups
)
<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.
This method is defined by DragDropMgr.
regDragDrop
public function regDragDrop( DragDrop oDD
, String sGroup
)
<static> Each DragDrop instance must be registered with the DragDropMgr.
This is executed in DragDrop.init()
This method is defined by DragDropMgr.
regHandle
public function regHandle( String sDDId
, String sHandleId
)
<static> Each DragDrop handle element must be registered. This is done
automatically when executing DragDrop.setHandleElId()
This method is defined by DragDropMgr.
startDrag
public function startDrag( x {int}
, y {int}
)
<static> Fired when either the drag pixel threshol or the mousedown hold
time threshold has been met.
This method is defined by DragDropMgr.
stopEvent
public function stopEvent( Event e
)
<static> Utility to stop event propagation and event default, if these
features are turned on.
This method is defined by DragDropMgr.
swapNode
public function swapNode( n1 the
, n2 the
)
<static> Swap two nodes. In IE, we use the native method, for others we
emulate the IE behavior
Parameters:
the
: n1first node to swap
the
: n2other node to swap
Returns:
This method is defined by DragDropMgr.
unlock
public function unlock()
<static> Unlock all drag and drop functionality
This method is defined by DragDropMgr.
verifyEl
public function verifyEl( HTMLElement el
)
<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
: HTMLElementthe element to check
Returns:
This method is defined by DragDropMgr.