Login Register Help
API Documentation
Choose a stylesheet:

Constructordojo.dnd.Source

dojo.require("dojo.dnd.Source");
a Source object, which can be used as a DnD source, or a DnD target

Usage

var foo=new dojo.dnd.Source(node: DOMNode|String, params: dojo.dnd.__SourceArgs?);
parametertypedescription
nodeDOMNode|Stringnode or node's id to build the source on
paramsdojo.dnd.__SourceArgsOptional. any property of this class may be configured via the params object which is mixed-in to the dojo.dnd.Source instance

a dict of parameters for DnD Source configuration. Note that any property on Source elements may be configured, but this is the short-list
fieldtypedescription
acceptArraylist of accepted types (text strings) for a target; defaults to ["text"]
autoSyncBooleanif true refreshes the node list on every operation; false by default
copyOnlyBooleancopy items, if true, use a state of Ctrl key otherwise, see selfCopy and selfAccept for more details
delayNumberthe move delay in pixels before detecting a drag; 0 by default
generateTextBooleangenerate text node for drag and drop, true by default
horizontalBooleana horizontal container, if true, vertical otherwise or when omitted
isSourceBooleancan be used as a DnD source. Defaults to true.
selfAcceptBooleanaccept its own items when copyOnly is true, true by default, works only if copyOnly is true
selfCopyBooleancopy items by default when dropping on itself, false by default, works only if copyOnly is true
withHandlesBooleanallows dragging only by handles, false by default

Jump to PropertiesFunctionsBack to top

FunctioncheckAcceptance(source: Object:, nodes: Array:): Boolean
checks if the target can accept nodes from this source
Defined by dojo.dnd.Container
removes all data items from the map
a constructor of the Source
FunctioncopyState(keyPressed: Boolean:, self: Boolean:?): Boolean
Returns true if we need to copy items, false to move. It is separated to be overwritten dynamically, if needed.
Defined by dojo.dnd.Selector
deletes all selected items
Defined by dojo.dnd.Container
removes a data item from the map by its key (id)
prepares the object to be garbage-collected
Defined by dojo.dnd.Container
iterates over a data map skipping members that are present in the empty object (IE and/or 3rd-party libraries).
Defined by dojo.dnd.Selector
iterates over selected items; see dojo.dnd.Container.forInItems() for details
FunctiongetAllNodes(): NodeList
Defined by dojo.dnd.Container
returns a list (an array) of all valid child nodes
Defined by dojo.dnd.Container
returns a data item by its key (id)
FunctiongetSelectedNodes(): Array | NodeList
Defined by dojo.dnd.Selector
returns a list (an array) of selected nodes
FunctioninsertNodes(addSelected: Boolean:, data: Array:, before: Boolean:, anchor: Node:): self
inserts new data items (see dojo.dnd.Container.insertNodes() method for details)
topic event processor for /dnd/cancel, called to cancel the DnD operation
FunctiononDndDrop(source: Object:, nodes: Array:, copy: Boolean:, target: Object:)
topic event processor for /dnd/drop, called to finish the DnD operation
FunctiononDndSourceOver(source: Object:)
topic event processor for /dnd/source/over, called when detected a current source
FunctiononDndStart(source: Object:, nodes: Array:, copy: Boolean:)
topic event processor for /dnd/start, called to initiate the DnD operation
called during the active DnD operation, when items are dragged away from this target, and it is not disabled
called during the active DnD operation, when items are dragged over this target, and it is not disabled
FunctiononDrop(source: Object:, nodes: Array:, copy: Boolean:)
called only on the current target, when drop is performed
FunctiononDropExternal(source: Object:, nodes: Array:, copy: Boolean:)
called only on the current target, when drop is performed from an external source
FunctiononDropInternal(nodes: Array:, copy: Boolean:)
called only on the current target, when drop is performed from the same target/source
FunctiononMouseDown(e: Event:)
event processor for onmousedown
FunctiononMouseMove(e: Event:)
event processor for onmousemove
FunctiononMouseOut(e: Event:)
Defined by dojo.dnd.Container
event processor for onmouseout
FunctiononMouseOver(e: Event:)
Defined by dojo.dnd.Container
event processor for onmouseover
FunctiononMouseUp(e: Event:)
event processor for onmouseup
this function is called once, when mouse is out of our container
this function is called once, when mouse is over our container
FunctiononSelectStart(e: Event:)
Defined by dojo.dnd.Container
event processor for onselectevent and ondragevent
FunctionselectAll(): self
Defined by dojo.dnd.Selector
selects all items
FunctionselectNone(): self
Defined by dojo.dnd.Selector
unselects all items
FunctionsetItem(key: String, data: Object)
Defined by dojo.dnd.Container
associates a data item with its key (id)
Defined by dojo.dnd.Container
collects valid child items and populate the map
Functionsync(): self
sync up the node list with the data map
Function_addItemClass(node: Node:, type: String:)
Defined by dojo.dnd.Container
adds a class with prefix "dojoDndItem"
Function_changeState(type: String:, newState: String:)
Defined by dojo.dnd.Container
changes a named state to new state value
Function_getChildByEvent(e: Event:)
Defined by dojo.dnd.Container
gets a child, which is under the mouse at the moment, or null
checks if user clicked on "approved" items
changes source's state based on "copy" status
Function_markTargetAnchor(before: Boolean:)
assigns a class to the current target anchor based on "before" status
Function_normalizedCreator(node, hint)
adds all necessary data to the output of the user-supplied creator function
Defined by dojo.dnd.Selector
Function_removeItemClass(node: Node:, type: String:)
Defined by dojo.dnd.Container
removes a class with prefix "dojoDndItem"
Defined by dojo.dnd.Selector
unselects all items
removes a class of the current target anchor based on "before" status

Jump to FunctionsPropertiesBack to top

autosynchronizes the source with its list of DnD nodes, false by default
Defined by dojo.dnd.Container
creator function, dummy at the moment
Defined by dojo.dnd.Container
The DOM node the mouse is currently hovered over
Defined by dojo.dnd.Container
dojo.dnd.Item> Map from an item's id (which is also the DOMNode's id) to the dojo.dnd.Item itself.
Defined by dojo.dnd.Container
node or node's id to build the container on params: dojo.dnd.__ContainerArgs a dictionary of parameters
Defined by dojo.dnd.Selector
The set of id's that are currently selected, such that this.selection[id] == 1 if the node w/that id is selected. Can iterate over selected node's id's like: for(var id in this.selection)
Defined by dojo.dnd.Selector
allows selection of only one element, if true the rest of parameters are passed to the container
don't start the drag operation, if clicked on form elements dropParent: Node: node or node's id to use as the parent node for dropped items (must be underneath the 'node' parameter in the DOM) _skipStartup: Boolean: skip startup(), which collects children, for deferred initialization (this is used in the markup mode)