dijit._tree.dndSelector.onMouseDown
dojo.require("dijit._tree.dndSelector");
defined in dijit/_tree/dndSelector.js
event processor for onmousedown
Usage
function (e) (view source)
if(!this.current){ return; } var item = dijit.getEnclosingWidget(this.current).item var id = this.tree.model.getIdentity(item); if (!this.current.id) { this.current.id=id; } if (!this.current.type) { this.current.type="data"; } if(!this.singular && !dojo.dnd.getCopyKeyState(e) && !e.shiftKey && (this.current.id in this.selection)){ this.simpleSelection = true; dojo.stopEvent(e); return; } if(this.singular){ if(this.anchor == this.current){ if(dojo.dnd.getCopyKeyState(e)){ this.selectNone(); } }else{ this.selectNone(); this.anchor = this.current; this._addItemClass(this.anchor, "Anchor"); this.selection[this.current.id] = this.current; } }else{ if(!this.singular && e.shiftKey){ if (dojo.dnd.getCopyKeyState(e)){ //TODO add range to selection }else{ //TODO select new range from anchor } }else{ if(dojo.dnd.getCopyKeyState(e)){ if(this.anchor == this.current){ delete this.selection[this.anchor.id]; this._removeAnchor(); }else{ if(this.current.id in this.selection){ this._removeItemClass(this.current, "Selected"); delete this.selection[this.current.id]; }else{ if(this.anchor){ this._removeItemClass(this.anchor, "Anchor"); this._addItemClass(this.anchor, "Selected"); } this.anchor = this.current; this._addItemClass(this.current, "Anchor"); this.selection[this.current.id] = this.current; } } }else{ var item = dijit.getEnclosingWidget(this.current).item var id = this.tree.model.getIdentity(item); if(!(id in this.selection)){ this.selectNone(); this.anchor = this.current; this._addItemClass(this.current, "Anchor"); this.selection[id] = this.current; } } } } dojo.stopEvent(e);
parameter | type | description |
---|---|---|
e | mouse event |