Yahoo! UI Library

Drag and Drop  2.2.0

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

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

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:

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


Copyright © 2007 Yahoo! Inc. All rights reserved.