| centerFrame : booleanBy default the frame is positioned exactly where the drag element is, so
+ This class provides a container DD instance that allows dragging of multiple child source nodes.
+ This class does not move the drag target nodes, but a proxy element which may contain
+any DOM structure you wish. The DOM element to show in the proxy is provided by either a
+provided implementation of getDragData, or by registered draggables registered with Ext.dd.Registry
+ If you wish to provide draggability for an arbitrary number of DOM nodes, each of which represent some
+application object (For example nodes in a DataView) then use of this class
+is the most efficient way to "activate" those nodes.
+ By default, this class requires that draggable child nodes are registered with Ext.dd.Registry.
+However a simpler way to allow a DragZone to manage any number of draggable elements is to configure
+the DragZone with an implementation of the getDragData method which interrogates the passed
+mouse event to see if it has taken place within an element, or class of elements. This is easily done
+by using the event's getTarget method to identify a node based on a
+Ext.DomQuery selector. For example, to make the nodes of a DataView draggable, use the following
+technique. Knowledge of the use of the DataView is required: myDataView.on('render', function(v) {
+ myDataView.dragZone = new Ext.dd.DragZone(v.getEl(), {
+
+// On receipt of a mousedown event, see if it is within a DataView node.
+// Return a drag data object if so.
+ getDragData: function(e) {
+
+// Use the DataView's own itemSelector (a mandatory property) to
+// test if the mousedown is within one of the DataView's nodes.
+ var sourceEl = e.getTarget(v.itemSelector, 10);
+
+// If the mousedown is within a DataView node, clone the node to produce
+// a ddel element for use by the drag proxy. Also add application data
+// to the returned data object.
+ if (sourceEl) {
+ d = sourceEl.cloneNode(true);
+ d.id = Ext.id();
+ return {
+ ddel: d,
+ sourceEl: sourceEl,
+ repairXY: Ext.fly(sourceEl).getXY(),
+ sourceStore: v.store,
+ draggedRecord: v.getRecord(sourceEl)
+ }
+ }
+ },
+
+// Provide coordinates for the proxy to slide back to on failed drag.
+// This is the original XY coordinates of the draggable element captured
+// in the getDragData method.
+ getRepairXY: function() {
+ return this.dragData.repairXY;
+ }
+ });
+});
+See the DropZone documentation for details about building a DropZone which
+cooperates with this DragZone. Config Options|
| containerScroll : Boolean True to register this container with the Scrollmanager
+for auto scrolling during drag operations. | DragZone | | ddGroup : StringA named drag drop group to which this object belongs. If a group is specified, then this object will only
+interact w... A named drag drop group to which this object belongs. If a group is specified, then this object will only
+interact with other drag drop objects in the same group (defaults to undefined). | DragSource | | dropAllowed : String The CSS class returned to the drag source when drop is allowed (defaults to "x-dd-drop-ok"). | DragSource | | dropNotAllowed : String The CSS class returned to the drag source when drop is not allowed (defaults to "x-dd-drop-nodrop"). | DragSource | | hlColor : StringThe color to use when visually highlighting the drag source in the afterRepair
+method after a failed drop (defaults t... The color to use when visually highlighting the drag source in the afterRepair
+method after a failed drop (defaults to "c3daf9" - light blue) | DragZone |
Public Properties|
| Ext.dd.DDProxy.dragElId : String The default drag frame div id | DDProxy | | available : boolean The available property is false until the linked dom element is accessible. | DragDrop | | centerFrame : booleanBy default the frame is positioned exactly where the drag element is, so
we use the cursor offset provided by Ext.dd.... By default the frame is positioned exactly where the drag element is, so
we use the cursor offset provided by Ext.dd.DD. Another option that works only if
you do not have constraints on the obj is to have the drag frame centered
-around the cursor. Set centerFrame to true for this effect. | DDProxy | | config : object Configuration attributes passed into the constructor | DragDrop | | defaultPadding : Object Provides default constraint padding to "constrainTo" elements (defaults to {left: 0, right:0, top:0, bottom:0}). | DragDrop | | dragData : ObjectThis property contains the data representing the dragged object. This data is set up by the implementation
-of the ge... This property contains the data representing the dragged object. This data is set up by the implementation
-of the getDragData method. It must contain a ddel property, but can contain
+around the cursor. Set centerFrame to true for this effect. | DDProxy | | config : object Configuration attributes passed into the constructor | DragDrop | | defaultPadding : Object Provides default constraint padding to "constrainTo" elements (defaults to {left: 0, right:0, top:0, bottom:0}). | DragDrop | | dragData : ObjectThis property contains the data representing the dragged object. This data is set up by the implementation
+of the get... This property contains the data representing the dragged object. This data is set up by the implementation
+of the getDragData method. It must contain a ddel property, but can contain
any other data according to the application's needs. | DragZone | | groups : object An object in the format {'group1':true, 'group2':trueThe group defines a logical collection of DragDrop objects that are
related. Instances only get events when interact... The group defines a logical collection of DragDrop objects that are
related. Instances only get events when interacting with other
@@ -132,24 +127,24 @@ instances belong to at least one group, and can belon...
instances belong to at least one group, and can belong to as many
groups as needed. Parameters:{string} : sGroupthe name of the group Returns: | DragDrop | | afterDragDrop( Ext.dd.DragDrop target , Event e , String id )
:
- voidAn empty function by default, but provided so that you can perform a custom action
-after a valid drag drop has occur... An empty function by default, but provided so that you can perform a custom action
+ void An empty function by default, but provided so that you can perform a custom action
+after a valid drag drop has occurr... An empty function by default, but provided so that you can perform a custom action
after a valid drag drop has occurred by providing an implementation. | DragSource | | afterDragEnter( Ext.dd.DragDrop target , Event e , String id )
:
- voidAn empty function by default, but provided so that you can perform a custom action
-when the dragged item enters the ... An empty function by default, but provided so that you can perform a custom action
+ void An empty function by default, but provided so that you can perform a custom action
+when the dragged item enters the d... An empty function by default, but provided so that you can perform a custom action
when the dragged item enters the drop target by providing an implementation. | DragSource | | afterDragOut( Ext.dd.DragDrop target , Event e , String id )
:
- voidAn empty function by default, but provided so that you can perform a custom action
-after the dragged item is dragged... An empty function by default, but provided so that you can perform a custom action
+ void An empty function by default, but provided so that you can perform a custom action
+after the dragged item is dragged ... An empty function by default, but provided so that you can perform a custom action
after the dragged item is dragged out of the target without dropping. | DragSource | | afterDragOver( Ext.dd.DragDrop target , Event e , String id )
:
- voidAn empty function by default, but provided so that you can perform a custom action
-while the dragged item is over th... An empty function by default, but provided so that you can perform a custom action
+ void An empty function by default, but provided so that you can perform a custom action
+while the dragged item is over the... An empty function by default, but provided so that you can perform a custom action
while the dragged item is over the drop target by providing an implementation. | DragSource | | afterInvalidDrop( Event e , String id )
:
- voidAn empty function by default, but provided so that you can perform a custom action
-after an invalid drop has occurre... An empty function by default, but provided so that you can perform a custom action
+ void An empty function by default, but provided so that you can perform a custom action
+after an invalid drop has occurred... An empty function by default, but provided so that you can perform a custom action
after an invalid drop has occurred by providing an implementation. | DragSource | | afterRepair()
:
voidCalled after a repair of an invalid drop. By default, highlights this.dragData.ddel Called after a repair of an invalid drop. By default, highlights this.dragData.ddel | DragZone | | alignElWithMouse( HTMLElement el , int iPageX , int iPageY )
@@ -177,24 +172,24 @@ Ext.dd.DragDrop.Event that fires prior to the onMouseDown event. Overrides
Ext.dd.DragDrop. | DD | | beforeDragDrop( Ext.dd.DragDrop target , Event e , String id )
:
- BooleanAn empty function by default, but provided so that you can perform a custom action before the dragged
-item is droppe... An empty function by default, but provided so that you can perform a custom action before the dragged
+ Boolean An empty function by default, but provided so that you can perform a custom action before the dragged
+item is dropped... An empty function by default, but provided so that you can perform a custom action before the dragged
item is dropped onto the target and optionally cancel the onDragDrop. | DragSource | | beforeDragEnter( Ext.dd.DragDrop target , Event e , String id )
:
- BooleanAn empty function by default, but provided so that you can perform a custom action
-before the dragged item enters th... An empty function by default, but provided so that you can perform a custom action
+ Boolean An empty function by default, but provided so that you can perform a custom action
+before the dragged item enters the... An empty function by default, but provided so that you can perform a custom action
before the dragged item enters the drop target and optionally cancel the onDragEnter. | DragSource | | beforeDragOut( Ext.dd.DragDrop target , Event e , String id )
:
- BooleanAn empty function by default, but provided so that you can perform a custom action before the dragged
-item is dragge... An empty function by default, but provided so that you can perform a custom action before the dragged
+ Boolean An empty function by default, but provided so that you can perform a custom action before the dragged
+item is dragged... An empty function by default, but provided so that you can perform a custom action before the dragged
item is dragged out of the target without dropping, and optionally cancel the onDragOut. | DragSource | | beforeDragOver( Ext.dd.DragDrop target , Event e , String id )
:
- BooleanAn empty function by default, but provided so that you can perform a custom action
-while the dragged item is over th... An empty function by default, but provided so that you can perform a custom action
+ Boolean An empty function by default, but provided so that you can perform a custom action
+while the dragged item is over the... An empty function by default, but provided so that you can perform a custom action
while the dragged item is over the drop target and optionally cancel the onDragOver. | DragSource | | beforeInvalidDrop( Ext.dd.DragDrop target , Event e , String id )
:
- BooleanAn empty function by default, but provided so that you can perform a custom action after an invalid
-drop has occurre... An empty function by default, but provided so that you can perform a custom action after an invalid
+ Boolean An empty function by default, but provided so that you can perform a custom action after an invalid
+drop has occurred... An empty function by default, but provided so that you can perform a custom action after an invalid
drop has occurred. | DragSource | | cachePosition( iPageX the , iPageY the )
:
voidSaves the most recent position so that we can reset the constraints and
@@ -232,10 +227,10 @@ an object containing the sides to pad. For example: {right:10, bottom:10} <
:
void Fired when we are done dragging the object Fired when we are done dragging the object Parameters:e : Eventthe mouseup event Returns: | DragDrop | | getDragData( EventObject e )
:
- ObjectCalled when a mousedown occurs in this container. Looks in Ext.dd.Registry
-for a valid target to drag based on the m... Called when a mousedown occurs in this container. Looks in Ext.dd.Registry
-for a valid target to drag based on the mouse down. Override this method
-to provide your own lookup logic (e.g. finding a child by class name). Make sure your returned
+ Object Called when a mousedown occurs in this container. Looks in Ext.dd.Registry
+for a valid target to drag based on the mo... Called when a mousedown occurs in this container. Looks in Ext.dd.Registry
+for a valid target to drag based on the mouse down. Override this method
+to provide your own lookup logic (e.g. finding a child by class name). Make sure your returned
object has a "ddel" attribute (with an HTML Element) for other functions to work. Parameters:e : EventObjectThe mouse down event Returns: | DragZone | | getDragEl()
:
HTMLElementReturns a reference to the actual element to drag. By default this is
@@ -247,8 +242,8 @@ element. An example of this can be found in Ext.dd.DDProxy Returns the drag source's underlying Ext.dd.StatusProxy Returns the drag source's underlying Ext.dd.StatusProxyParameters:Returns:Ext.dd.StatusProxy proxy The StatusProxy
| DragSource | | getRepairXY( EventObject e )
:
- ArrayCalled before a repair of an invalid drop to get the XY to animate to. By default returns
-the XY of this.dragData.dd... Called before a repair of an invalid drop to get the XY to animate to. By default returns
+ Array Called before a repair of an invalid drop to get the XY to animate to. By default returns
+the XY of this.dragData.dde... Called before a repair of an invalid drop to get the XY to animate to. By default returns
the XY of this.dragData.ddel Parameters:e : EventObjectThe mouse up event Returns: | DragZone | | hideProxy()
:
voidHides the drag source's Ext.dd.StatusProxy | DragSource | | init( id the , String sGroup , object config )
@@ -278,8 +273,8 @@ false | Override the onAvailable method to do what is needed after the initial
position was determined. | DragDrop | | onBeforeDrag( Object data , Event e )
:
- BooleanAn empty function by default, but provided so that you can perform a custom action before the initial
-drag event beg... An empty function by default, but provided so that you can perform a custom action before the initial
+ Boolean An empty function by default, but provided so that you can perform a custom action before the initial
+drag event begi... An empty function by default, but provided so that you can perform a custom action before the initial
drag event begins and optionally cancel it. | DragSource | | onDrag( Event e )
:
voidAbstract method called during the onMouseMove event while dragging an
@@ -308,8 +303,8 @@ DragDrop obj | DragDrop | | onInitDrag( Number x , Number y )
:
- BooleanCalled once drag threshold has been reached to initialize the proxy element. By default, it clones the
-this.dragData... Called once drag threshold has been reached to initialize the proxy element. By default, it clones the
+ Boolean Called once drag threshold has been reached to initialize the proxy element. By default, it clones the
+this.dragData.... Called once drag threshold has been reached to initialize the proxy element. By default, it clones the
this.dragData.ddel | DragZone | | onInvalidDrop( Event e )
:
voidAbstract method called when this item is dropped on an area with no
@@ -320,8 +315,8 @@ drop target Parameters:Event handler that fires when a drag/drop obj gets a mouseup Event handler that fires when a drag/drop obj gets a mouseup Parameters:e : Eventthe mouseup event Returns:
| DragDrop | | onStartDrag( Number x , Number y )
:
- voidAn empty function by default, but provided so that you can perform a custom action once the initial
-drag event has b... An empty function by default, but provided so that you can perform a custom action once the initial
+ void An empty function by default, but provided so that you can perform a custom action once the initial
+drag event has be... An empty function by default, but provided so that you can perform a custom action once the initial
drag event has begun. The drag cannot be canceled from this function. | DragSource | | removeFromGroup( string sGroup )
:
voidRemove's this instance from the supplied interaction group Remove's this instance from the supplied interaction group Parameters:sGroup : stringThe group to drop Returns: | DragDrop | | removeInvalidHandleClass( string cssClass )
|
|