dojox/mdnd/PureSource (version 1.10)

dojo/dnd/Selector

Summary

A Source Object, which can be used only as a DnD source. A Source can contained several dnd items. A dnd item is not a source.

Usage

var foo = new PureSource(node,params);
dojox/mdnd/PureSource
Parameter Type Description
node DOMNode | String

Node or node's id to build the source on.

params dojo.dnd.__SourceArgs
Optional

Any property of this class may be configured via the params object which is mixed-in to the 'dojo.dnd.Source' instance.

See the dojox/mdnd/PureSource reference documentation for more information.

Property Summary

Method Summary

  • _addItemClass(node,type) adds a class with prefix "dojoDndItem"
  • _changeState(type,newState) changes a named state to new state value
  • _getChildByEvent(e) gets a child, which is under the mouse at the moment, or null
  • _legalMouseDown(e) Checks if user clicked on "approved" items.
  • _markDndStatus(copy) Changes source's state based on "copy" status.
  • _normalizedCreator(item,hint) adds all necessary data to the output of the user-supplied creator function
  • _removeAnchor()
  • _removeItemClass(node,type) removes a class with prefix "dojoDndItem"
  • _removeSelection() unselects all items
  • clearItems() removes all data items from the map
  • copyState(keyPressed) Returns true, if we need to copy items, false to move.
  • creator() creator function, dummy at the moment
  • deleteSelectedNodes() deletes all selected items
  • delItem(key) removes a data item from the map by its key (id)
  • destroy() Prepares the object to be garbage-collected.
  • emit(type,event)
  • forInItems(f,o) iterates over a data map skipping members that are present in the empty object (IE and/or 3rd-party libraries).
  • forInSelectedItems(f,o) iterates over selected items; see dojo/dnd/Container.forInItems() for details
  • getAllNodes() returns a list (an array) of all valid child nodes
  • getItem(key) returns a data item by its key (id)
  • getSelectedNodes() returns a list (an array) of selected nodes
  • insertNodes(addSelected,data,before,anchor) inserts new data items (see dojo/dnd/Container.insertNodes() method for details)
  • markupFactory(params,node) Markup methods.
  • on(type,listener)
  • selectAll() selects all items
  • selectNone() unselects all items
  • setItem(key,data) associates a data item with its key (id)
  • startup() collects valid child items and populate the map
  • sync() sync up the node list with the data map

Event Summary

  • onDndCancel() Topic event processor for /dnd/cancel, called to cancel the Dnd operation.
  • onMouseDown(e) Event processor for onmousedown.
  • onMouseMove(e) Event processor for onmousemove.
  • onMouseOut(e) event processor for onmouseout
  • onMouseOver(e) event processor for onmouseover or touch, to mark that element as the current element
  • onMouseUp(e) Event processor for onmouseup.
  • onOutEvent() Called once, when mouse is out our container.
  • onOverEvent() Called once, when mouse is over our container.
  • onSelectStart(e) event processor for onselectevent and ondragevent

Properties

allowNested
Defined by: dojo/dnd/Container

Indicates whether to allow dnd item nodes to be nested within other elements. By default this is false, indicating that only direct children of the container can be draggable dnd item nodes

copyOnly
Defined by: dojox/mdnd/PureSource
current
Defined by: dojo/dnd/Container

The DOM node the mouse is currently hovered over

generateText
Defined by: dojox/mdnd/PureSource
horizontal
Defined by: dojox/mdnd/PureSource
isSource
Defined by: dojox/mdnd/PureSource
map
Defined by: dojo/dnd/Container

Map from an item's id (which is also the DOMNode's id) to the dojo/dnd/Container.Item itself.

selection
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)
singular
Defined by: dojo/dnd/Selector
skipForm
Defined by: dojox/mdnd/PureSource
targetState
Defined by: dojox/mdnd/PureSource
withHandles
Defined by: dojox/mdnd/PureSource

Methods

_addItemClass(node,type)
Defined by dojo/dnd/Container

adds a class with prefix "dojoDndItem"

Parameter Type Description
node Node

a node

type String

a variable suffix for a class name

_changeState(type,newState)
Defined by dojo/dnd/Container

changes a named state to new state value

Parameter Type Description
type String

a name of the state to change

newState String

new state

_getChildByEvent(e)
Defined by dojo/dnd/Container

gets a child, which is under the mouse at the moment, or null

Parameter Type Description
e Event

a mouse event

Returns:undefined | null
_legalMouseDown(e)

Checks if user clicked on "approved" items.

Parameter Type Description
e Event

Mouse event.

Returns:any | boolean

True if user clicked on "approved" items.

_markDndStatus(copy)

Changes source's state based on "copy" status.

Parameter Type Description
copy Boolean

Copy status.

_normalizedCreator(item,hint)
Defined by dojo/dnd/Container

adds all necessary data to the output of the user-supplied creator function

Parameter Type Description
item Container.Item
hint String
Returns:undefined
_removeAnchor()
Defined by dojo/dnd/Selector
Returns:function
_removeItemClass(node,type)
Defined by dojo/dnd/Container

removes a class with prefix "dojoDndItem"

Parameter Type Description
node Node

a node

type String[]

Type(s) of this item, by default this is ["text"]

_removeSelection()
Defined by dojo/dnd/Selector

unselects all items

Returns:function

unselects all items

clearItems()
Defined by dojo/dnd/Container

removes all data items from the map

copyState(keyPressed)

Returns true, if we need to copy items, false to move. It is separated to be overwritten dynamically, if needed.

Parameter Type Description
keyPressed Boolean

The "copy" was pressed.

Returns:any | undefined

True, if we need to copy items, false to move.

creator()
Defined by dojo/dnd/Container

creator function, dummy at the moment

deleteSelectedNodes()
Defined by dojo/dnd/Selector

deletes all selected items

Returns:function

deletes all selected items

delItem(key)
Defined by dojo/dnd/Container

removes a data item from the map by its key (id)

Parameter Type Description
key String
destroy()

Prepares the object to be garbage-collected.

emit(type,event)
Defined by dojo/Evented
Parameter Type Description
type undefined
event undefined
Returns:undefined
forInItems(f,o)
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).

Parameter Type Description
f Function
o Object
Optional
Returns:string
forInSelectedItems(f,o)
Defined by dojo/dnd/Selector

iterates over selected items; see dojo/dnd/Container.forInItems() for details

Parameter Type Description
f Function
o Object
Optional
getAllNodes()
Defined by dojo/dnd/Container

returns a list (an array) of all valid child nodes

Returns:undefined
getItem(key)
Defined by dojo/dnd/Container

returns a data item by its key (id)

Parameter Type Description
key String
Returns:undefined
getSelectedNodes()
Defined by dojo/dnd/Selector

returns a list (an array) of selected nodes

Returns:instance
insertNodes(addSelected,data,before,anchor)
Defined by dojo/dnd/Selector

inserts new data items (see dojo/dnd/Container.insertNodes() method for details)

Parameter Type Description
addSelected Boolean

all new nodes will be added to selected items, if true, no selection change otherwise

data Array

a list of data items, which should be processed by the creator function

before Boolean

insert before the anchor, if true, and after the anchor otherwise

anchor Node

the anchor node to be used as a point of insertion

Returns:function

inserts new data items (see dojo/dnd/Container.insertNodes() method for details)

markupFactory(params,node)

Markup methods.

Parameter Type Description
params Object

???

node DomNode

???

Returns:any | instance

New dojox.mdnd.PureSource instance.

on(type,listener)
Defined by dojo/Evented
Parameter Type Description
type undefined
listener undefined
Returns:undefined
selectAll()
Defined by dojo/dnd/Selector

selects all items

Returns:undefined
selectNone()
Defined by dojo/dnd/Selector

unselects all items

Returns:undefined
setItem(key,data)
Defined by dojo/dnd/Container

associates a data item with its key (id)

Parameter Type Description
key String
data Container.Item
startup()
Defined by dojo/dnd/Container

collects valid child items and populate the map

sync()
Defined by dojo/dnd/Selector

sync up the node list with the data map

Returns:function

sync up the node list with the data map

Events

onDndCancel()
Defined by: dojox/mdnd/PureSource

Topic event processor for /dnd/cancel, called to cancel the Dnd operation.

onMouseDown(e)
Defined by: dojox/mdnd/PureSource

Event processor for onmousedown.

Parameter Type Description
e Event

Mouse event.

onMouseMove(e)
Defined by: dojox/mdnd/PureSource

Event processor for onmousemove.

Parameter Type Description
e Event

Mouse event.

onMouseOut(e)
Defined by: dojo/dnd/Container

event processor for onmouseout

Parameter Type Description
e Event

mouse event

onMouseOver(e)
Defined by: dojo/dnd/Container

event processor for onmouseover or touch, to mark that element as the current element

Parameter Type Description
e Event

mouse event

onMouseUp(e)
Defined by: dojox/mdnd/PureSource

Event processor for onmouseup.

Parameter Type Description
e Event

Mouse event

onOutEvent()
Defined by: dojox/mdnd/PureSource

Called once, when mouse is out our container.

onOverEvent()
Defined by: dojox/mdnd/PureSource

Called once, when mouse is over our container.

onSelectStart(e)
Defined by: dojo/dnd/Container

event processor for onselectevent and ondragevent

Parameter Type Description
e Event

mouse event

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