Drag And Drop manager
See the dojox/mdnd/AreaManager reference documentation for more information.
Create a draggable item with a DOM node.
Parameter | Type | Description |
---|---|---|
node | DOMNode | A child of the D&D Area. |
The draggable item.
Delete the Moveable object associated with a node.
Parameter | Type | Description |
---|---|---|
objItem | Object |
Get the children of a D&D area.
Parameter | Type | Description |
---|---|---|
area | DOMNode | A DnD area. |
The children of a DnD area
Get the index of an area.
Parameter | Type | Description |
---|---|---|
area | DOMNode | A moveable Object. |
area index or -1
True if user can drop widget on this node.
Parameter | Type | Description |
---|---|---|
type | Array | Array containing item type |
accept | Array | Array containing types |
place the dropIndicator
Parameter | Type | Description |
---|---|---|
size | Object | an object encapsulating width and height values |
Return the node which contains the first specific CSS class handle.
Parameter | Type | Description |
---|---|---|
node | DOMNode | A child of the D&D Area. |
The drag handle node.
Set the value of margin in the data type of areaManager only when the margin has never been computed.
Parameter | Type | Description |
---|---|---|
area | Object | The object of a D&D Area. |
node | DOMNode | The node which contains margins |
To add an item programmatically.
Parameter | Type | Description |
---|---|---|
area | DOMNode | a node corresponding to the D&D Area |
node | DOMNode | the node which has to be treated. |
index | Integer | the place in the area |
notCheckParent | Boolean |
True if the node has been inserted else false.
find the nearest target area according to coordinates. Coordinates are representing by an object : for example, {'x':10,'y':10}
Parameter | Type | Description |
---|---|---|
coords | Object | an object encapsulating X and Y position |
size | Object | an object encapsulating the area size |
an index of area
Initialize the manager by calling the registerByClass method
Search the right place to insert the dropIndicator and display the dropIndicator.
Parameter | Type | Description |
---|---|---|
coords | Object | an object encapsulating X and Y position |
size | Object | an object encapsulating width and height values |
the current drop index
Register all Dnd Areas identified by the attribute areaClass : insert Dnd Areas using the specific sort of dropMode.
To register Dnd Area : insert the DndArea using the specific sort of dropMode.
Parameter | Type | Description |
---|---|---|
area | DOMNode | a DOM node corresponding to the Dnd Area |
notInitAreas | Boolean | if false or undefined, init the areas. |
Delete a moveable item programmatically. The node is removed from the area.
Parameter | Type | Description |
---|---|---|
area | DOMNode | A node corresponding to the DndArea. |
node | DOMNode | The node which has to be treated. |
the removed node
Unregister a D&D Area and its children into the AreaManager.
Parameter | Type | Description |
---|---|---|
area | DOMNode | A node corresponding to the D&D Area. |
True if the area is found and unregistered.
Occurs when the dojo.dnd.Moveable.onDrag is fired. Search the nearest target area and called the placeDropIndicator
Parameter | Type | Description |
---|---|---|
node | DOMNode | The node which is dragged |
coords | Object | an object encapsulating X and Y position |
size | Object | an object encapsulating width and height values |
mousePosition | Object | coordinates of mouse |
Optionally called by the getTargetArea method of TargetFinder class.
Parameter | Type | Description |
---|---|---|
coords | Object | coordinates of the dragged Node. |
size | Object | size of the dragged Node. |
Optionally called by the getTargetArea method of TargetFinder class.
Parameter | Type | Description |
---|---|---|
coords | Object | coordinates of the dragged Node. |
size | Object | size of the dragged Node. |
Initialize the drag (see dojox.mdnd.Moveable.initOffsetDrag())
Parameter | Type | Description |
---|---|---|
node | DOMNode | The node which is about to be dragged |
coords | Object | an object encapsulating X and Y position |
size | Object | an object encapsulating width and height values |
Drop the dragged item where the dropIndicator is displayed.
Parameter | Type | Description |
---|---|---|
node | DOMNode | The node which is about to be dropped |
Cancel the drop. The dragNode returns into the source.