root / trunk / web / dojo / dojox / grid / util.js @ 12
History | View | Annotate | Download (1.41 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.util"]){ |
||
9 | dojo._hasResource["dojox.grid.util"]=true; |
||
10 | dojo.provide("dojox.grid.util");
|
||
11 | (function(){
|
||
12 | var _1=dojox.grid.util;
|
||
13 | _1.na="...";
|
||
14 | _1.rowIndexTag="gridRowIndex";
|
||
15 | _1.gridViewTag="gridView";
|
||
16 | _1.fire=function(ob,ev,_2){ |
||
17 | var fn=ob&&ev&&ob[ev];
|
||
18 | return fn&&(_2?fn.apply(ob,_2):ob[ev]());
|
||
19 | }; |
||
20 | _1.setStyleHeightPx=function(_3,_4){ |
||
21 | if(_4>=0){ |
||
22 | var s=_3.style;
|
||
23 | var v=_4+"px"; |
||
24 | if(_3&&s["height"]!=v){ |
||
25 | s["height"]=v;
|
||
26 | } |
||
27 | } |
||
28 | }; |
||
29 | _1.mouseEvents=["mouseover","mouseout","mousedown","mouseup","click","dblclick","contextmenu"]; |
||
30 | _1.keyEvents=["keyup","keydown","keypress"]; |
||
31 | _1.funnelEvents=function(_5,_6,_7,_8){ |
||
32 | var _9=(_8?_8:_1.mouseEvents.concat(_1.keyEvents));
|
||
33 | for(var i=0,l=_9.length;i<l;i++){ |
||
34 | _6.connect(_5,"on"+_9[i],_7);
|
||
35 | } |
||
36 | }; |
||
37 | _1.removeNode=function(_a){ |
||
38 | _a=dojo.byId(_a); |
||
39 | _a&&_a.parentNode&&_a.parentNode.removeChild(_a); |
||
40 | return _a;
|
||
41 | }; |
||
42 | _1.arrayCompare=function(_b,_c){ |
||
43 | for(var i=0,l=_b.length;i<l;i++){ |
||
44 | if(_b[i]!=_c[i]){
|
||
45 | return false; |
||
46 | } |
||
47 | } |
||
48 | return (_b.length==_c.length);
|
||
49 | }; |
||
50 | _1.arrayInsert=function(_d,_e,_f){ |
||
51 | if(_d.length<=_e){
|
||
52 | _d[_e]=_f; |
||
53 | }else{
|
||
54 | _d.splice(_e,0,_f);
|
||
55 | } |
||
56 | }; |
||
57 | _1.arrayRemove=function(_10,_11){ |
||
58 | _10.splice(_11,1);
|
||
59 | }; |
||
60 | _1.arraySwap=function(_12,inI,inJ){ |
||
61 | var _13=_12[inI];
|
||
62 | _12[inI]=_12[inJ]; |
||
63 | _12[inJ]=_13; |
||
64 | }; |
||
65 | })(); |
||
66 | } |