dojox/mdnd/adapter/DndToDojo (version 1.10)

Summary

Allow communication between an item of dojox D&D area to a target dojo.

Usage

var foo = new DndToDojo();
dojox/mdnd/adapter/DndToDojo

Property Summary

Method Summary

  • _getHoverDojoArea(coords) Check if the coordinates of the mouse is in a dojo target.
  • _getIndexDojoArea(area) Check if a dojo area is registered.
  • _initCoordinates(area) Initialize the coordinates of the target dojo.
  • isAccepted(draggedNode,target) Return true if the dragged node is accepted.
  • refresh() Refresh the coordinates of all registered dojo target.
  • refreshByType(type) Refresh the coordinates of registered dojo target with a specific type.
  • register(area,type,dojoTarget) Register a target dojo.
  • unregister() Unregister all targets dojo.
  • unregisterByNode(area) Unregister a target dojo.
  • unregisterByType(type) Unregister several targets dojo having the same type passing in parameter.

Event Summary

  • onDragEnter(e) Call when the mouse enters in a registered dojo target.
  • onDragExit(e) Call when the mouse exit of a registered dojo target.
  • onDrop(e) Called when an onmouseup event is loaded on a registered target dojo.
  • onMouseMove(e) Call when the mouse moving after an onStartDrag of AreaManger.

Properties

_currentDojoArea

Representing the current dojo area

_dojoList

Array containing object references the dojo Target list

_dojoxManager

The reference to the dojox AreaManager

_draggedNode

The current dragged node

_dragStartHandler

Handle to keep start subscribe

_dropHandler

Handle to keep drop subscribe

_moveHandler

Handle to keep move subscribe

_moveUpHandler

Handle to kee move up subscribe

Methods

_getHoverDojoArea(coords)

Check if the coordinates of the mouse is in a dojo target.

Parameter Type Description
coords Object

Coordinates of the mouse.

_getIndexDojoArea(area)

Check if a dojo area is registered.

Parameter Type Description
area DOMNode

A node corresponding to the target dojo.

Returns:any | number

The index of area if it's registered else -1.

_initCoordinates(area)

Initialize the coordinates of the target dojo.

Parameter Type Description
area DOMNode

A registered DOM node.

Returns:any | object | null

An object which contains coordinates : {x:0,y:,x1:0,y1:0}

isAccepted(draggedNode,target)

Return true if the dragged node is accepted. This method has to be overwritten according to registered target.

Parameter Type Description
draggedNode DOMNode
target Object
Returns:boolean
refresh()

Refresh the coordinates of all registered dojo target.

refreshByType(type)

Refresh the coordinates of registered dojo target with a specific type.

Parameter Type Description
type String

A String to identify dojo targets.

register(area,type,dojoTarget)

Register a target dojo. The target is represented by an object containing :

  • the dojo area node
  • the type reference to identify a group node
  • the coords of the area to enable refresh position
Parameter Type Description
area DOMNode

The DOM node which has to be registered.

type String

A String to identify the node.

dojoTarget Boolean

True if the dojo D&D have to be enable when mouse is hover the registered target dojo.

unregister()

Unregister all targets dojo.

unregisterByNode(area)

Unregister a target dojo.

Parameter Type Description
area DOMNode

The DOM node of target dojo.

unregisterByType(type)

Unregister several targets dojo having the same type passing in parameter.

Parameter Type Description
type String

A String to identify dojo targets.

Events

onDragEnter(e)

Call when the mouse enters in a registered dojo target.

Parameter Type Description
e DOMEvent

The current Javascript Event.

onDragExit(e)

Call when the mouse exit of a registered dojo target.

Parameter Type Description
e DOMEvent

current javscript event

onDrop(e)

Called when an onmouseup event is loaded on a registered target dojo.

Parameter Type Description
e DOMEvent

Event object.

onMouseMove(e)

Call when the mouse moving after an onStartDrag of AreaManger. Check if the coordinates of the mouse is in a dojo target.

Parameter Type Description
e DOMEvent

Event object.

Error in the documentation? Can’t find what you are looking for? Let us know!