A special source that can accept grid contents. Only for non-grid widgets or domNodes.
Parameter | Type | Description |
---|---|---|
node | DOMNode | String | node or node's id to build the source on |
params | Object |
Optional any property of this class may be configured via the params
object which is mixed-in to the |
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
If you'd like to insert some sort of nodes into your dnd source, turn this on, and override getCellContent/getRowContent/getColumnContent to populate the dnd data in your desired format.
Map from an item's id (which is also the DOMNode's id) to the dojo/dnd/Container.Item itself.
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)
adds a class with prefix "dojoDndItem"
Parameter | Type | Description |
---|---|---|
node | Node | a node |
type | String | a variable suffix for a class name |
changes a named state to new state value
Parameter | Type | Description |
---|---|---|
type | String | a name of the state to change |
newState | String | new state |
gets a child, which is under the mouse at the moment, or null
Parameter | Type | Description |
---|---|---|
e | Event | a mouse event |
checks if user clicked on "approved" items
Parameter | Type | Description |
---|---|---|
e | Event | mouse event |
changes source's state based on "copy" status
Parameter | Type | Description |
---|---|---|
copy | undefined |
assigns a class to the current target anchor based on "before" status
Parameter | Type | Description |
---|---|---|
before | Boolean | insert before, if true, after otherwise |
adds all necessary data to the output of the user-supplied creator function
Parameter | Type | Description |
---|---|---|
item | Container.Item | |
hint | String |
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"] |
removes a class of the current target anchor based on "before" status
Parameter | Type | Description |
---|---|---|
source | undefined | |
nodes | undefined |
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" key was pressed |
self | Boolean |
Optional optional flag that means that we are about to drop on itself |
removes a data item from the map by its key (id)
Parameter | Type | Description |
---|---|---|
key | String |
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
|
iterates over selected items;
see dojo/dnd/Container.forInItems()
for details
Parameter | Type | Description |
---|---|---|
f | Function | |
o | Object |
Optional
|
Fill node innerHTML for dnd grid cells.
Parameter | Type | Description |
---|---|---|
grid | undefined | |
leftTopCell | undefined | |
rightBottomCell | undefined |
var cells = grid.layout.cells; var store = grid.store; var cache = grid._by_idx; var res = "Grid Cells from " + grid.id + ":<br/>"; for(var r = leftTopCell.row; r <= rightBottomCell.row; ++r){ for(var c = leftTopCell.col; c <= rightBottomCell.col; ++c){ res += store.getValue(cache[r].item, cells[c].field) + ", "; } res = res.substring(0, res.length - 2) + ";<br/>"; } return res;
Fill node innerHTML for dnd grid columns.
Parameter | Type | Description |
---|---|---|
grid | undefined | |
colIndexes | undefined |
var cells = grid.layout.cells; var res = "Grid Columns from " + grid.id + ":"; for(var i = 0; i < colIndexes.length; ++i){ var c = colIndexes[i]; res += (cells[c].name || cells[c].field) + ", "; } return res.substring(0, res.length - 2);
returns a data item by its key (id)
Parameter | Type | Description |
---|---|---|
key | String |
Fill node innerHTML for dnd grid rows.
Parameter | Type | Description |
---|---|---|
grid | undefined | |
rowIndexes | undefined |
var cells = grid.layout.cells; var store = grid.store; var cache = grid._by_idx; var res = "Grid Rows from " + grid.id + ":<br/>"; for(var i = 0; i < rowIndexes.length; ++i){ var r = rowIndexes[i]; res += "Row " + r + ": "; for(var j = 0; j < cells.length; ++j){ if(!cells[j].hidden){ res += store.getValue(cache[r].item, cells[j].field) + ", "; } } res = res.substring(0, res.length - 2) + ";<br/>"; } return res;
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 |
inserts new data items (see dojo/dnd/Container.insertNodes()
method for details)
Parameter | Type | Description |
---|---|---|
params | undefined | |
node | undefined |
Parameter | Type | Description |
---|---|---|
type | undefined | |
listener | undefined |
associates a data item with its key (id)
Parameter | Type | Description |
---|---|---|
key | String | |
data | Container.Item |
sync up the node list with the data map
sync up the node list with the data map
topic event processor for /dnd/cancel, called to cancel the DnD operation
var cells = grid.layout.cells; var store = grid.store; var cache = grid._by_idx; var res = "Grid Rows from " + grid.id + ":<br/>"; for(var i = 0; i < rowIndexes.length; ++i){ var r = rowIndexes[i]; res += "Row " + r + ": "; for(var j = 0; j < cells.length; ++j){ if(!cells[j].hidden){ res += store.getValue(cache[r].item, cells[j].field) + ", "; } } res = res.substring(0, res.length - 2) + ";<br/>"; } return res;
topic event processor for /dnd/drop, called to finish the DnD operation
Parameter | Type | Description |
---|---|---|
source | Object | the source which provides items |
nodes | Array | the list of transferred items |
copy | Boolean | copy items, if true, move items otherwise |
target | Object | the target which accepts items |
var cells = grid.layout.cells; var store = grid.store; var cache = grid._by_idx; var res = "Grid Rows from " + grid.id + ":<br/>"; for(var i = 0; i < rowIndexes.length; ++i){ var r = rowIndexes[i]; res += "Row " + r + ": "; for(var j = 0; j < cells.length; ++j){ if(!cells[j].hidden){ res += store.getValue(cache[r].item, cells[j].field) + ", "; } } res = res.substring(0, res.length - 2) + ";<br/>"; } return res;
topic event processor for /dnd/source/over, called when detected a current source
Parameter | Type | Description |
---|---|---|
source | Object | the source which has the mouse over it |
var cells = grid.layout.cells; var store = grid.store; var cache = grid._by_idx; var res = "Grid Rows from " + grid.id + ":<br/>"; for(var i = 0; i < rowIndexes.length; ++i){ var r = rowIndexes[i]; res += "Row " + r + ": "; for(var j = 0; j < cells.length; ++j){ if(!cells[j].hidden){ res += store.getValue(cache[r].item, cells[j].field) + ", "; } } res = res.substring(0, res.length - 2) + ";<br/>"; } return res;
topic event processor for /dnd/start, called to initiate the DnD operation
Parameter | Type | Description |
---|---|---|
source | Object | the source which provides items |
nodes | Array | the list of transferred items |
copy | Boolean | copy items, if true, move items otherwise |
var cells = grid.layout.cells; var store = grid.store; var cache = grid._by_idx; var res = "Grid Rows from " + grid.id + ":<br/>"; for(var i = 0; i < rowIndexes.length; ++i){ var r = rowIndexes[i]; res += "Row " + r + ": "; for(var j = 0; j < cells.length; ++j){ if(!cells[j].hidden){ res += store.getValue(cache[r].item, cells[j].field) + ", "; } } res = res.substring(0, res.length - 2) + ";<br/>"; } return res;
var cells = grid.layout.cells; var store = grid.store; var cache = grid._by_idx; var res = "Grid Rows from " + grid.id + ":<br/>"; for(var i = 0; i < rowIndexes.length; ++i){ var r = rowIndexes[i]; res += "Row " + r + ": "; for(var j = 0; j < cells.length; ++j){ if(!cells[j].hidden){ res += store.getValue(cache[r].item, cells[j].field) + ", "; } } res = res.substring(0, res.length - 2) + ";<br/>"; } return res;
var cells = grid.layout.cells; var store = grid.store; var cache = grid._by_idx; var res = "Grid Rows from " + grid.id + ":<br/>"; for(var i = 0; i < rowIndexes.length; ++i){ var r = rowIndexes[i]; res += "Row " + r + ": "; for(var j = 0; j < cells.length; ++j){ if(!cells[j].hidden){ res += store.getValue(cache[r].item, cells[j].field) + ", "; } } res = res.substring(0, res.length - 2) + ";<br/>"; } return res;
called only on the current target, when drop is performed
Parameter | Type | Description |
---|---|---|
source | Object | the source which provides items |
nodes | Array | the list of transferred items |
copy | Boolean | copy items, if true, move items otherwise |
var cells = grid.layout.cells; var store = grid.store; var cache = grid._by_idx; var res = "Grid Rows from " + grid.id + ":<br/>"; for(var i = 0; i < rowIndexes.length; ++i){ var r = rowIndexes[i]; res += "Row " + r + ": "; for(var j = 0; j < cells.length; ++j){ if(!cells[j].hidden){ res += store.getValue(cache[r].item, cells[j].field) + ", "; } } res = res.substring(0, res.length - 2) + ";<br/>"; } return res;
Parameter | Type | Description |
---|---|---|
source | undefined | |
nodes | undefined | |
copy | undefined |
var cells = grid.layout.cells; var store = grid.store; var cache = grid._by_idx; var res = "Grid Rows from " + grid.id + ":<br/>"; for(var i = 0; i < rowIndexes.length; ++i){ var r = rowIndexes[i]; res += "Row " + r + ": "; for(var j = 0; j < cells.length; ++j){ if(!cells[j].hidden){ res += store.getValue(cache[r].item, cells[j].field) + ", "; } } res = res.substring(0, res.length - 2) + ";<br/>"; } return res;
Parameter | Type | Description |
---|---|---|
grid | undefined | |
leftTopCell | undefined | |
rightBottomCell | undefined |
var cells = grid.layout.cells; var store = grid.store; var cache = grid._by_idx; var res = "Grid Rows from " + grid.id + ":<br/>"; for(var i = 0; i < rowIndexes.length; ++i){ var r = rowIndexes[i]; res += "Row " + r + ": "; for(var j = 0; j < cells.length; ++j){ if(!cells[j].hidden){ res += store.getValue(cache[r].item, cells[j].field) + ", "; } } res = res.substring(0, res.length - 2) + ";<br/>"; } return res;
Parameter | Type | Description |
---|---|---|
grid | undefined | |
colIndexes | undefined |
var cells = grid.layout.cells; var store = grid.store; var cache = grid._by_idx; var res = "Grid Rows from " + grid.id + ":<br/>"; for(var i = 0; i < rowIndexes.length; ++i){ var r = rowIndexes[i]; res += "Row " + r + ": "; for(var j = 0; j < cells.length; ++j){ if(!cells[j].hidden){ res += store.getValue(cache[r].item, cells[j].field) + ", "; } } res = res.substring(0, res.length - 2) + ";<br/>"; } return res;
Parameter | Type | Description |
---|---|---|
grid | undefined | |
rowIndexes | undefined |
var cells = grid.layout.cells; var store = grid.store; var cache = grid._by_idx; var res = "Grid Rows from " + grid.id + ":<br/>"; for(var i = 0; i < rowIndexes.length; ++i){ var r = rowIndexes[i]; res += "Row " + r + ": "; for(var j = 0; j < cells.length; ++j){ if(!cells[j].hidden){ res += store.getValue(cache[r].item, cells[j].field) + ", "; } } res = res.substring(0, res.length - 2) + ";<br/>"; } return res;
called only on the current target, when drop is performed from the same target/source
Parameter | Type | Description |
---|---|---|
nodes | Array | the list of transferred items |
copy | Boolean | copy items, if true, move items otherwise |
var cells = grid.layout.cells; var store = grid.store; var cache = grid._by_idx; var res = "Grid Rows from " + grid.id + ":<br/>"; for(var i = 0; i < rowIndexes.length; ++i){ var r = rowIndexes[i]; res += "Row " + r + ": "; for(var j = 0; j < cells.length; ++j){ if(!cells[j].hidden){ res += store.getValue(cache[r].item, cells[j].field) + ", "; } } res = res.substring(0, res.length - 2) + ";<br/>"; } return res;
event processor for onmousedown
Parameter | Type | Description |
---|---|---|
e | Event | mouse event |
var cells = grid.layout.cells; var store = grid.store; var cache = grid._by_idx; var res = "Grid Rows from " + grid.id + ":<br/>"; for(var i = 0; i < rowIndexes.length; ++i){ var r = rowIndexes[i]; res += "Row " + r + ": "; for(var j = 0; j < cells.length; ++j){ if(!cells[j].hidden){ res += store.getValue(cache[r].item, cells[j].field) + ", "; } } res = res.substring(0, res.length - 2) + ";<br/>"; } return res;
event processor for onmousemove
Parameter | Type | Description |
---|---|---|
e | Event | mouse event |
var cells = grid.layout.cells; var store = grid.store; var cache = grid._by_idx; var res = "Grid Rows from " + grid.id + ":<br/>"; for(var i = 0; i < rowIndexes.length; ++i){ var r = rowIndexes[i]; res += "Row " + r + ": "; for(var j = 0; j < cells.length; ++j){ if(!cells[j].hidden){ res += store.getValue(cache[r].item, cells[j].field) + ", "; } } res = res.substring(0, res.length - 2) + ";<br/>"; } return res;
event processor for onmouseout
Parameter | Type | Description |
---|---|---|
e | Event | mouse event |
var cells = grid.layout.cells; var store = grid.store; var cache = grid._by_idx; var res = "Grid Rows from " + grid.id + ":<br/>"; for(var i = 0; i < rowIndexes.length; ++i){ var r = rowIndexes[i]; res += "Row " + r + ": "; for(var j = 0; j < cells.length; ++j){ if(!cells[j].hidden){ res += store.getValue(cache[r].item, cells[j].field) + ", "; } } res = res.substring(0, res.length - 2) + ";<br/>"; } return res;
event processor for onmouseover or touch, to mark that element as the current element
Parameter | Type | Description |
---|---|---|
e | Event | mouse event |
var cells = grid.layout.cells; var store = grid.store; var cache = grid._by_idx; var res = "Grid Rows from " + grid.id + ":<br/>"; for(var i = 0; i < rowIndexes.length; ++i){ var r = rowIndexes[i]; res += "Row " + r + ": "; for(var j = 0; j < cells.length; ++j){ if(!cells[j].hidden){ res += store.getValue(cache[r].item, cells[j].field) + ", "; } } res = res.substring(0, res.length - 2) + ";<br/>"; } return res;
event processor for onmouseup
Parameter | Type | Description |
---|---|---|
e | Event | mouse event |
var cells = grid.layout.cells; var store = grid.store; var cache = grid._by_idx; var res = "Grid Rows from " + grid.id + ":<br/>"; for(var i = 0; i < rowIndexes.length; ++i){ var r = rowIndexes[i]; res += "Row " + r + ": "; for(var j = 0; j < cells.length; ++j){ if(!cells[j].hidden){ res += store.getValue(cache[r].item, cells[j].field) + ", "; } } res = res.substring(0, res.length - 2) + ";<br/>"; } return res;
this function is called once, when mouse is out of our container
var cells = grid.layout.cells; var store = grid.store; var cache = grid._by_idx; var res = "Grid Rows from " + grid.id + ":<br/>"; for(var i = 0; i < rowIndexes.length; ++i){ var r = rowIndexes[i]; res += "Row " + r + ": "; for(var j = 0; j < cells.length; ++j){ if(!cells[j].hidden){ res += store.getValue(cache[r].item, cells[j].field) + ", "; } } res = res.substring(0, res.length - 2) + ";<br/>"; } return res;
this function is called once, when mouse is over our container
var cells = grid.layout.cells; var store = grid.store; var cache = grid._by_idx; var res = "Grid Rows from " + grid.id + ":<br/>"; for(var i = 0; i < rowIndexes.length; ++i){ var r = rowIndexes[i]; res += "Row " + r + ": "; for(var j = 0; j < cells.length; ++j){ if(!cells[j].hidden){ res += store.getValue(cache[r].item, cells[j].field) + ", "; } } res = res.substring(0, res.length - 2) + ";<br/>"; } return res;
event processor for onselectevent and ondragevent
Parameter | Type | Description |
---|---|---|
e | Event | mouse event |
var cells = grid.layout.cells; var store = grid.store; var cache = grid._by_idx; var res = "Grid Rows from " + grid.id + ":<br/>"; for(var i = 0; i < rowIndexes.length; ++i){ var r = rowIndexes[i]; res += "Row " + r + ": "; for(var j = 0; j < cells.length; ++j){ if(!cells[j].hidden){ res += store.getValue(cache[r].item, cells[j].field) + ", "; } } res = res.substring(0, res.length - 2) + ";<br/>"; } return res;