# Yahoo! UI Library

### Drag and Drop 2.5.0

Yahoo! UI Library > dragdrop > YAHOO.util.DDProxy

Show Private Show Protected

## Class YAHOO.util.DDProxy - extends YAHOO.util.DD

Known Subclasses:
  YAHOO.util.ColumnResizer YAHOO.util.ColumnDD

A DragDrop implementation that inserts an empty, bordered div into the document that follows the cursor during drag operations. At the time of the click, the frame div is resized to the dimensions of the linked html element, and moved to the exact location of the linked element. References to the "frame" element refer to the single proxy element that was created to be dragged in place of all DDProxy elements on the page.

### Constructor

YAHOO.util.DDProxy `( id , sGroup , config )`

Parameters:
  `id <String>` the id of the linked html element
  `sGroup <String>` the group of related DragDrop objects
  `config <object>` an object containing configurable attributes Valid properties for DDProxy in addition to those in DragDrop: resizeFrame, centerFrame, dragElId

### Properties

#### centerFrame `- boolean`

By default the frame is positioned exactly where the drag element is, so we use the cursor offset provided by YAHOO.util.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.

#### resizeFrame `- boolean`

By default we resize the drag frame to be the same size as the element we want to drag (this is to get the frame effect). We can turn it off if we want a different behavior.

#### YAHOO.util.DDProxy.dragElId `- static String`

The default drag frame div id

#### Properties inherited from YAHOO.util.DD:

`scroll`

#### Properties inherited from YAHOO.util.DragDrop:

`__ygDragDrop, _domRef, available, config, constrainX, constrainY, cursorIsOver, deltaX, deltaY, dragElId, dragOnly, events, groups, handleElId, hasOuterHandles, id, invalidHandleClasses, invalidHandleIds, invalidHandleTypes, isTarget, locked, maintainOffset, maxX, maxY, minX, minY, overlap, padding, primaryButtonOnly, startPageX, startPageY, xTicks, yTicks`

### Methods

#### _resizeProxy

`private void _resizeProxy ( )`
The proxy is automatically resized to the dimensions of the linked element when a drag is initiated, unless resizeFrame is set to false

Returns: `void`

#### createFrame

`void createFrame ( )`
Creates the proxy element if it does not yet exist

Returns: `void`

#### initFrame

`void initFrame ( )`
Initialization for the drag frame element. Must be called in the constructor of all subclasses

Returns: `void`

#### showFrame

`private void showFrame ( iPageX , iPageY )`
Resizes the drag frame to the dimensions of the clicked object, positions it over the object, and finally displays it

Parameters:
  `iPageX <int>` X click position
  `iPageY <int>` Y click position

Returns: `void`

#### Methods inherited from YAHOO.util.DD:

`alignElWithMouse, autoOffset, autoScroll, cachePosition, setDelta, setDragElPos`

#### Methods inherited from YAHOO.util.DragDrop:

`addInvalidHandleClass, addInvalidHandleId, addInvalidHandleType, addToGroup, applyConfig, b4Drag, b4DragDrop, b4DragOut, b4DragOver, b4EndDrag, b4MouseDown, b4StartDrag, clearConstraints, clearTicks, clickValidator, endDrag, getDragEl, getEl, getTargetCoord, getTick, handleMouseDown, handleOnAvailable, init, initTarget, isLocked, isValidHandleChild, lock, on, onAvailable, onDrag, onDragDrop, onDragEnter, onDragOut, onDragOver, onInvalidDrop, onMouseDown, onMouseUp, removeFromGroup, removeInvalidHandleClass, removeInvalidHandleId, removeInvalidHandleType, resetConstraints, setDragElId, setHandleElId, setInitialPosition, setOuterHandleElId, setPadding, setStartPosition, setXConstraint, setXTicks, setYConstraint, setYTicks, startDrag, toString, unlock, unreg`

### Events

#### b4DragDropEvent

`b4DragDropEvent ( )`
Fires before the dragDropEvent

#### b4DragEvent

`b4DragEvent ( )`
Fires before the dragEvent.

#### b4DragOutEvent

`b4DragOutEvent ( )`
Fires before the dragOutEvent

#### b4DragOverEvent

`b4DragOverEvent ( )`
Fires before the dragOverEvent.

#### b4EndDragEvent

`b4EndDragEvent ( )`
Fires before the endDragEvent. Returning false will cancel.

#### b4MouseDownEvent

`b4MouseDownEvent ( )`
Provides access to the mousedown event, before the mouseDownEvent gets fired. Returning false will cancel the drag.

#### b4StartDragEvent

`b4StartDragEvent ( )`
Fires before the startDragEvent, returning false will cancel the startDrag Event.

#### dragDropEvent

`dragDropEvent ( )`
Fires when the dragged objects is dropped on another.

#### dragEnterEvent

`dragEnterEvent ( )`
Occurs when the dragged object first interacts with another targettable drag and drop object.

#### dragEvent

`dragEvent ( )`
Occurs every mousemove event while dragging.

#### dragOutEvent

`dragOutEvent ( )`
Fires when a dragged object is no longer over an object that had the onDragEnter fire.

#### dragOverEvent

`dragOverEvent ( )`
Fires every mousemove event while over a drag and drop object.

#### endDragEvent

`endDragEvent ( )`
Fires on the mouseup event after a drag has been initiated (startDrag fired).

#### invalidDropEvent

`invalidDropEvent ( )`
Fires when the dragged objects is dropped in a location that contains no drop targets.

#### mouseDownEvent

`mouseDownEvent ( )`
Provides access to the mousedown event. The mousedown does not always result in a drag operation.

#### mouseUpEvent

`mouseUpEvent ( )`
Fired from inside DragDropMgr when the drag operation is finished.

#### startDragEvent

`startDragEvent ( )`
Occurs after a mouse down and the drag threshold has been met. The drag threshold default is either 3 pixels of mouse movement or 1 full second of holding the mousedown.

#### Events inherited from YAHOO.util.DD:

`b4DragDropEvent, b4DragEvent, b4DragOutEvent b4DragOverEvent b4EndDragEvent b4MouseDownEvent b4StartDragEvent dragDropEvent dragEnterEvent dragEvent dragOutEvent dragOverEvent endDragEvent invalidDropEvent mouseDownEvent mouseUpEvent startDragEvent`

#### Events inherited from YAHOO.util.DragDrop:

`b4DragDropEvent, b4DragEvent, b4DragOutEvent, b4DragOverEvent, b4EndDragEvent, b4MouseDownEvent, b4StartDragEvent, dragDropEvent, dragEnterEvent, dragEvent, dragOutEvent, dragOverEvent, endDragEvent, invalidDropEvent, mouseDownEvent, mouseUpEvent, startDragEvent,`

Copyright © 2007 Yahoo! Inc. All rights reserved.