root / trunk / web / dojo / dojox / grid / _RowManager.js @ 12
History | View | Annotate | Download (1.39 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._RowManager"]){ |
||
9 | dojo._hasResource["dojox.grid._RowManager"]=true; |
||
10 | dojo.provide("dojox.grid._RowManager");
|
||
11 | (function(){
|
||
12 | var _1=function(_2,_3){ |
||
13 | if(_2.style.cssText==undefined){ |
||
14 | _2.setAttribute("style",_3);
|
||
15 | }else{
|
||
16 | _2.style.cssText=_3; |
||
17 | } |
||
18 | }; |
||
19 | dojo.declare("dojox.grid._RowManager",null,{constructor:function(_4){ |
||
20 | this.grid=_4;
|
||
21 | },linesToEms:2,overRow:-2,prepareStylingRow:function(_5,_6){ |
||
22 | return {index:_5,node:_6,odd:Boolean(_5&1),selected:!!this.grid.selection.isSelected(_5),over:this.isOver(_5),customStyles:"",customClasses:"dojoxGridRow"}; |
||
23 | },styleRowNode:function(_7,_8){ |
||
24 | var _9=this.prepareStylingRow(_7,_8); |
||
25 | this.grid.onStyleRow(_9);
|
||
26 | this.applyStyles(_9);
|
||
27 | },applyStyles:function(_a){ |
||
28 | var i=_a;
|
||
29 | i.node.className=i.customClasses; |
||
30 | var h=i.node.style.height;
|
||
31 | _1(i.node,i.customStyles+";"+(i.node._style||"")); |
||
32 | i.node.style.height=h; |
||
33 | },updateStyles:function(_b){ |
||
34 | this.grid.updateRowStyles(_b);
|
||
35 | },setOverRow:function(_c){ |
||
36 | var _d=this.overRow; |
||
37 | this.overRow=_c;
|
||
38 | if((_d!=this.overRow)&&(dojo.isString(_d)||_d>=0)){ |
||
39 | this.updateStyles(_d);
|
||
40 | } |
||
41 | this.updateStyles(this.overRow); |
||
42 | },isOver:function(_e){ |
||
43 | return (this.overRow==_e&&!dojo.hasClass(this.grid.domNode,"dojoxGridColumnResizing")); |
||
44 | }}); |
||
45 | })(); |
||
46 | } |