root / trunk / web / dojo / dojox / grid / enhanced / _Builder.js
History | View | Annotate | Download (2.28 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._Builder"]){ |
||
9 | dojo._hasResource["dojox.grid.enhanced._Builder"]=true; |
||
10 | dojo.provide("dojox.grid.enhanced._Builder");
|
||
11 | dojo.require("dojox.grid._Builder");
|
||
12 | dojo.declare("dojox.grid.enhanced._BuilderMixin",null,{generateCellMarkup:function(_1,_2,_3,_4){ |
||
13 | var _5=this.inherited(arguments); |
||
14 | if(!_4){
|
||
15 | _5[4]+="<div class=\"dojoxGridCellContent\">"; |
||
16 | _5[6]="</div></td>"; |
||
17 | } |
||
18 | return _5;
|
||
19 | },domouseup:function(e){ |
||
20 | if(e.cellNode){
|
||
21 | this.grid.onMouseUp(e);
|
||
22 | } |
||
23 | }}); |
||
24 | dojo.declare("dojox.grid.enhanced._HeaderBuilder",[dojox.grid._HeaderBuilder,dojox.grid.enhanced._BuilderMixin],{getCellX:function(e){ |
||
25 | if(this.grid.nestedSorting){ |
||
26 | var _6=function(_7,_8){ |
||
27 | for(var n=_7;n&&_8(n);n=n.parentNode){ |
||
28 | } |
||
29 | return n;
|
||
30 | }; |
||
31 | var _9=function(_a){ |
||
32 | var _b=_a.toUpperCase();
|
||
33 | return function(_c){ |
||
34 | return _c.tagName!=_b;
|
||
35 | }; |
||
36 | }; |
||
37 | var no=_6(e.target,_9("th")); |
||
38 | var x=no?e.pageX-dojo.coords(no,true).x:-1; |
||
39 | if(dojo.isIE){
|
||
40 | var _d=dojo.body().getBoundingClientRect();
|
||
41 | var _e=(_d.right-_d.left)/document.body.clientWidth;
|
||
42 | return parseInt(x/_e);
|
||
43 | } |
||
44 | return x;
|
||
45 | } |
||
46 | return this.inherited(arguments); |
||
47 | },decorateEvent:function(e){ |
||
48 | var _f=this.inherited(arguments); |
||
49 | if(this.grid.nestedSorting){ |
||
50 | var _10=this.grid._getSortEventInfo(e); |
||
51 | e.unarySortChoice=_10.unarySortChoice; |
||
52 | e.nestedSortChoice=_10.nestedSortChoice; |
||
53 | e.selectChoice=_10.selectChoice; |
||
54 | } |
||
55 | return _f;
|
||
56 | },doclick:function(e){ |
||
57 | if((this._skipBogusClicks&&!this.grid.nestedSorting)||(this.grid.nestedSorting&&this.grid.ignoreEvent(e))){ |
||
58 | dojo.stopEvent(e); |
||
59 | return true; |
||
60 | } |
||
61 | },colResizeSetup:function(e,_11){ |
||
62 | var _12=this.minColWidth; |
||
63 | if(e.sourceView.grid.nestedSorting&&!this.grid.pluginMgr.isFixedCell(e.cell)){ |
||
64 | this.minColWidth=this.grid.getMinColWidth(); |
||
65 | var _13=dojo.connect(this,"endResizeColumn",dojo.hitch(this,function(){ |
||
66 | this.minColWidth=_12;
|
||
67 | dojo.disconnect(_13); |
||
68 | })); |
||
69 | } |
||
70 | var _14=this.inherited(arguments); |
||
71 | if(!dojo._isBodyLtr()&&dojo.isIE&&_14.followers){
|
||
72 | dojo.forEach(_14.followers,function(_15){
|
||
73 | if(!_15.left){
|
||
74 | _15.left=dojo.position(_15.node).x; |
||
75 | } |
||
76 | }); |
||
77 | } |
||
78 | return _14;
|
||
79 | }}); |
||
80 | dojo.declare("dojox.grid.enhanced._ContentBuilder",[dojox.grid._ContentBuilder,dojox.grid.enhanced._BuilderMixin],{});
|
||
81 | } |