root / trunk / web / dojo / dojox / grid / enhanced / dnd / _DndEvents.js
History | View | Annotate | Download (1.64 KB)
1 | 9 | andrej.cim | /*
|
---|---|---|---|
2 | Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved.
|
||
3 | Available via Academic Free License >= 2.1 OR the modified BSD license.
|
||
4 | see: http://dojotoolkit.org/license for details
|
||
5 | */
|
||
6 | |||
7 | |||
8 | if(!dojo._hasResource["dojox.grid.enhanced.dnd._DndEvents"]){ |
||
9 | dojo._hasResource["dojox.grid.enhanced.dnd._DndEvents"]=true; |
||
10 | dojo.provide("dojox.grid.enhanced.dnd._DndEvents");
|
||
11 | dojo.declare("dojox.grid.enhanced.dnd._DndEvents",null,{rowBarActiveClass:"dojoxGridRowBarActive",onMouseUp:function(e){ |
||
12 | e.rowIndex==-1?this.onHeaderCellMouseUp(e):this.onCellMouseUp(e); |
||
13 | this.select.resetStartPoint();
|
||
14 | this.select.clearInSelectingMode();
|
||
15 | !isNaN(e.rowIndex)&&e.cellIndex==-1&&this.focus.focusRowBarNode(e.rowIndex); |
||
16 | },onMouseUpRow:function(e){ |
||
17 | if(this.dndSelectable){ |
||
18 | }else{
|
||
19 | if(e.rowIndex!=-1){ |
||
20 | this.onRowMouseUp(e);
|
||
21 | } |
||
22 | } |
||
23 | },onCellMouseUp:function(e){ |
||
24 | if(e.cellIndex>this.select.exceptColumnsTo){ |
||
25 | this.select.setInSelectingMode("cell",true); |
||
26 | } |
||
27 | },onRowHeaderMouseDown:function(e){ |
||
28 | this.focus._colHeadNode=this.focus._colHeadFocusIdx=null; |
||
29 | this.focus.focusRowBarNode(e.rowIndex);
|
||
30 | if(e.button==2){ |
||
31 | return;
|
||
32 | } |
||
33 | this.select.setInSelectingMode("row",true); |
||
34 | this.select.keepState=e.ctrlKey&&!this.pluginMgr.inSingleSelection(); |
||
35 | this.select.extendSelect=e.shiftKey;
|
||
36 | this.select.setDrugStartPoint(-1,e.rowIndex); |
||
37 | if(this.select.extendSelect&&!this.pluginMgr.inSingleSelection()){ |
||
38 | this.select.restorLastDragPoint();
|
||
39 | } |
||
40 | this.select.drugSelectRow(e.rowIndex);
|
||
41 | dojo.addClass(e.rowNode,this.rowBarActiveClass);
|
||
42 | dojo.stopEvent(e); |
||
43 | },onRowHeaderMouseUp:function(e){ |
||
44 | this.onMouseUp(e);
|
||
45 | dojo.removeClass(e.rowNode,this.rowBarActiveClass);
|
||
46 | },onRowMouseUp:function(e){ |
||
47 | this.select.setInSelectingMode("row",false); |
||
48 | }}); |
||
49 | } |