# Yahoo! UI Library

### dd 3.3.0

Yahoo! UI Library > dd > DD.Delegate
Search:
Filters Show Private Show Protected Show Deprecated

## Class DD.Delegate - extends Base

Provides the ability to drag multiple nodes under a container element using only one Y.DD.Drag instance as a delegate.

### Constructor

DD.Delegate `( )`

### Properties

#### _bubbleTargets - `private object`

The default bubbleTarget for this object. Default: Y.DD.DDM

#### _handles - `private object`

Array of event handles to be destroyed

#### _shimState - `private object`

The state of the Y.DD.DDM._noShim property to it can be reset.

#### dd - `object`

A reference to the temporary dd instance used under the hood.

#### Properties inherited from Plugin.Host:

`PluginHost`

#### Properties inherited from Attribute:

``

#### Properties inherited from Base:

`name`

### Methods

#### _afterDragEnd

`private void _afterDragEnd ( e )`
Listens for the drag:end event and updates the temp dd instance.

Parameters:
  `e <Event>` The Event.

#### _delMouseDown

`private void _delMouseDown ( e )`
The callback for the Y.DD.Delegate instance used

Parameters:
  `e <Event>` The MouseDown Event.

#### _onMouseEnter

`private void _onMouseEnter ( e )`
Sets the target shim state

Parameters:
  `e <Event>` The MouseEnter Event

#### _onMouseLeave

`private void _onMouseLeave ( e )`
Resets the target shim state

Parameters:
  `e <Event>` The MouseLeave Event

#### _onNodeChange

`private void _onNodeChange ( e )`
Listens to the nodeChange event and sets the dragNode on the temp dd instance.

Parameters:
  `e <Event>` The Event.

#### createDrop

`createDrop ( node , groups )`
Apply the Drop plugin to this node

Parameters:
  `node <Node>` The Node to apply the plugin to
  `groups <Array>` The default groups to assign this target to.

Returns: ``
  Node

#### syncTargets

`Self syncTargets ( )`
Applies the Y.Plugin.Drop to all nodes matching the cont + nodes selector query.
Chainable: This method is chainable.

#### Methods inherited from EventTarget:

`_getType, _monitor, _parseType, addTarget, after, before, bubble, detach, detachAll, fire, getEvent, getTargets, on, once, parseType, publish, removeTarget, subscribe, unsubscribe, unsubscribeAll`

#### Methods inherited from Attribute:

`_addAttrs, _addLazyAttr, _defAttrChangeFn, _fireAttrChange, _getAttr, _getAttrCfg, _getAttrInitVal, _getAttrs, _getStateVal, _isLazyAttr, _normAttrVals, _protectAttrs, _set, _setAttr, _setAttrs, _setAttrVal, _setStateVal, addAttr, addAttrs, attrAdded, get, getAttrs, modifyAttr, removeAttr, reset, set, setAttrs`

#### Methods inherited from Plugin.Host:

`_destroyPlugins, _initPlugins, hasPlugin, plug, unplug`

#### Methods inherited from Base:

`_aggregateAttrs, _defDestroyFn, _defInitFn, _destroyHierarchy, _filterAttrCfs, _getAttrCfgs, _getClasses, _initHierarchy, _initHierarchyData, _preInitEventCfg, destroy, init, toString`

### Events

#### containerChange

`containerChange ( event )`
Fires when the value for the configuration attribute 'container' is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.

Parameters:
  `event <Event.Facade>` An Event Facade object with the following attribute specific properties added:
  prevVal
    The value of the attribute, prior to it being set
  newVal
    The value the attribute is to be set to
  attrName
    The name of the attribute being set
  subAttrName
    If setting a property within the attribute's value, the name of the sub-attribute property being set

#### currentNodeChange

`currentNodeChange ( event )`
Fires when the value for the configuration attribute 'currentNode' is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.

Parameters:
  `event <Event.Facade>` An Event Facade object with the following attribute specific properties added:
  prevVal
    The value of the attribute, prior to it being set
  newVal
    The value the attribute is to be set to
  attrName
    The name of the attribute being set
  subAttrName
    If setting a property within the attribute's value, the name of the sub-attribute property being set

#### dragConfigChange

`dragConfigChange ( event )`
Fires when the value for the configuration attribute 'dragConfig' is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.

Parameters:
  `event <Event.Facade>` An Event Facade object with the following attribute specific properties added:
  prevVal
    The value of the attribute, prior to it being set
  newVal
    The value the attribute is to be set to
  attrName
    The name of the attribute being set
  subAttrName
    If setting a property within the attribute's value, the name of the sub-attribute property being set

#### dragNodeChange

`dragNodeChange ( event )`
Fires when the value for the configuration attribute 'dragNode' is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.

Parameters:
  `event <Event.Facade>` An Event Facade object with the following attribute specific properties added:
  prevVal
    The value of the attribute, prior to it being set
  newVal
    The value the attribute is to be set to
  attrName
    The name of the attribute being set
  subAttrName
    If setting a property within the attribute's value, the name of the sub-attribute property being set

#### handlesChange

`handlesChange ( event )`
Fires when the value for the configuration attribute 'handles' is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.

Parameters:
  `event <Event.Facade>` An Event Facade object with the following attribute specific properties added:
  prevVal
    The value of the attribute, prior to it being set
  newVal
    The value the attribute is to be set to
  attrName
    The name of the attribute being set
  subAttrName
    If setting a property within the attribute's value, the name of the sub-attribute property being set

#### invalidChange

`invalidChange ( event )`
Fires when the value for the configuration attribute 'invalid' is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.

Parameters:
  `event <Event.Facade>` An Event Facade object with the following attribute specific properties added:
  prevVal
    The value of the attribute, prior to it being set
  newVal
    The value the attribute is to be set to
  attrName
    The name of the attribute being set
  subAttrName
    If setting a property within the attribute's value, the name of the sub-attribute property being set

#### lastNodeChange

`lastNodeChange ( event )`
Fires when the value for the configuration attribute 'lastNode' is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.

Parameters:
  `event <Event.Facade>` An Event Facade object with the following attribute specific properties added:
  prevVal
    The value of the attribute, prior to it being set
  newVal
    The value the attribute is to be set to
  attrName
    The name of the attribute being set
  subAttrName
    If setting a property within the attribute's value, the name of the sub-attribute property being set

#### nodesChange

`nodesChange ( event )`
Fires when the value for the configuration attribute 'nodes' is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.

Parameters:
  `event <Event.Facade>` An Event Facade object with the following attribute specific properties added:
  prevVal
    The value of the attribute, prior to it being set
  newVal
    The value the attribute is to be set to
  attrName
    The name of the attribute being set
  subAttrName
    If setting a property within the attribute's value, the name of the sub-attribute property being set

#### overChange

`overChange ( event )`
Fires when the value for the configuration attribute 'over' is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.

Parameters:
  `event <Event.Facade>` An Event Facade object with the following attribute specific properties added:
  prevVal
    The value of the attribute, prior to it being set
  newVal
    The value the attribute is to be set to
  attrName
    The name of the attribute being set
  subAttrName
    If setting a property within the attribute's value, the name of the sub-attribute property being set

#### targetChange

`targetChange ( event )`
Fires when the value for the configuration attribute 'target' is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.

Parameters:
  `event <Event.Facade>` An Event Facade object with the following attribute specific properties added:
  prevVal
    The value of the attribute, prior to it being set
  newVal
    The value the attribute is to be set to
  attrName
    The name of the attribute being set
  subAttrName
    If setting a property within the attribute's value, the name of the sub-attribute property being set

#### Events inherited from Base:

`destroy, destroyedChange, init, initializedChange,`

### Configuration Attributes

#### container `- String`

A selector query to get the container to listen for mousedown events on. All "nodes" should be a child of this container.

#### currentNode `- Node`

Y.Node instance of the dd node.

#### dragConfig `- Object`

The default config to be used when creating the DD instance.

#### dragNode `- Node`

Y.Node instance of the dd dragNode.

#### handles `- Array`

The handles config option added to the temp DD instance.

#### invalid `- String`

A selector query to test a node to see if it's an invalid item.

#### lastNode `- Node`

Y.Node instance of the last item dragged.

#### nodes `- String`

A selector query to get the children of the "container" to make draggable elements from.

#### over `- Boolean`

Is the mouse currently over the container

#### target `- Boolean`

Should the items also be a drop target.

#### Configuration attributes inherited from Base:

`destroyed initialized`

Copyright © 2011 Yahoo! Inc. All rights reserved.