Constructordojo.dnd.Source

dojo.require("dojo.dnd.Source");
defined in dojo/dnd/Source.js

a constructor of the Source

Usage

function (/*DOMNode|String*/ node, /*dojo.dnd.__SourceArgs?*/ params) (view source)
parametertypedescription
nodeDOMNode|Stringor 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
.acceptArrayOptional. list of accepted types (text strings) for a target; defaults to ["text"]
.copyOnlyBooleanOptional. always copy items, if true, use a state of Ctrl key otherwise
.horizontalBooleanOptional. a horizontal container, if true, vertical otherwise or when omitted
.isSourceBooleanOptional. can be used as a DnD source. Defaults to true.
.withHandlesBooleanOptional. allows dragging only by handles

Jump to PropertiesJump to FunctionsConstructorsBack to top

ConstructorinsertNodes(addSelected: Boolean, data: Array, before: Boolean, anchor: Node)
inserts new data items (see Container's insertNodes method for details)
ConstructoronDndDrop(source: Object, nodes: Array, copy: Boolean)
topic event processor for /dnd/drop, called to finish the DnD operation

Jump to PropertiesJump to ConstructorsFunctionsBack to top

FunctioncheckAcceptance(source: Object, nodes: Array)
checks, if the target can accept nodes from this source
Defined by dojo.dnd.Container
removes all data items from the map
FunctioncopyState(keyPressed: 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.Container
a creator function, which takes a data item, and returns an object like that: {node: newNode, data: usedData, type: arrayOfStrings}
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, which are present in the empty object (IE and/or 3rd-party libraries).
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)
Defined by dojo.dnd.Selector
returns a list (an array) of selected nodes
topic event processor for /dnd/cancel, called to cancel the DnD operation
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
event processor for onmousedown
event processor for onmousemove
Defined by dojo.dnd.Container
event processor for onmouseout
Defined by dojo.dnd.Container
event processor for onmouseover
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
Defined by dojo.dnd.Container
event processor for onselectevent and ondragevent
Defined by dojo.dnd.Selector
selects all items
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 set up the real parent node
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
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
assigns a class to the current target anchor based on "before" status
Function_normalizedCreator(item, hint)
adds all necessary data to the output of the user-supplied creator function
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 FunctionsJump to ConstructorsPropertiesBack to top

Defined by dojo.dnd.Container
node or node's id to build the container on
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 _skipStartup: Boolean: skip startup(), which collects children, for deferred initialization (this is used in the markup mode)