dojo/dnd/Container (version 1.10)

dojo/Evented

Summary

a Container object, which knows when mouse hovers over it, and over which element it hovers

Usage

var foo = new Container(node,params);
dojo/dnd/Container
Parameter Type Description
node Node

node or node's id to build the container on

params Container.__ContainerArgs

a dictionary of parameters

See the dojo/dnd/Container reference documentation for more information.

Property Summary

  • allowNestedIndicates whether to allow dnd item nodes to be nested within other elements.
  • currentThe DOM node the mouse is currently hovered over
  • mapMap from an item's id (which is also the DOMNode's id) to the dojo/dnd/Container.Item itself.
  • skipForm

Method Summary

  • __ContainerArgs()
  • _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
  • _normalizedCreator(item,hint) adds all necessary data to the output of the user-supplied creator function
  • _removeItemClass(node,type) removes a class with prefix "dojoDndItem"
  • clearItems() removes all data items from the map
  • creator() creator function, dummy at the moment
  • delItem(key) removes a data item from the map by its key (id)
  • destroy() prepares this 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).
  • getAllNodes() returns a list (an array) of all valid child nodes
  • getItem(key) returns a data item by its key (id)
  • insertNodes(data,before,anchor) inserts an array of new nodes before/after an anchor node
  • Item() Represents (one of) the source node(s) being dragged.
  • markupFactory(params,node,Ctor)
  • on(type,listener)
  • 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

  • onMouseOut(e) event processor for onmouseout
  • onMouseOver(e) event processor for onmouseover or touch, to mark that element as the current element
  • onOutEvent() this function is called once, when mouse is out of our container
  • onOverEvent() this function is 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

current
Defined by: dojo/dnd/Container

The DOM node the mouse is currently hovered over

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.

skipForm
Defined by: dojo/dnd/Container

Methods

__ContainerArgs()
Defined by dojo/dnd/Container
_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
_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
_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"]

clearItems()
Defined by dojo/dnd/Container

removes all data items from the map

creator()
Defined by dojo/dnd/Container

creator function, dummy at the moment

delItem(key)
Defined by dojo/dnd/Container

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

Parameter Type Description
key String
destroy()
Defined by dojo/dnd/Container

prepares this 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
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
insertNodes(data,before,anchor)
Defined by dojo/dnd/Container

inserts an array of new nodes before/after an anchor node

Parameter Type Description
data Object

Logical representation of the object being dragged. If the drag object's type is "text" then data is a String, if it's another type then data could be a different Object, perhaps a name/value hash.

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 an array of new nodes before/after an anchor node

Item()
Defined by dojo/dnd/Container

Represents (one of) the source node(s) being dragged. Contains (at least) the "type" and "data" attributes.

markupFactory(params,node,Ctor)
Defined by dojo/dnd/Container
Parameter Type Description
params undefined
node undefined
Ctor undefined
Returns:instance
on(type,listener)
Defined by dojo/Evented
Parameter Type Description
type undefined
listener undefined
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/Container

sync up the node list with the data map

Returns:function

sync up the node list with the data map

Events

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

onOutEvent()
Defined by: dojo/dnd/Container

this function is called once, when mouse is out of our container

onOverEvent()
Defined by: dojo/dnd/Container

this function is 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!