1 if(!dojo._hasResource["dojox.grid._grid.rows"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
2 dojo._hasResource["dojox.grid._grid.rows"] = true;
3 dojo.provide("dojox.grid._grid.rows");
5 dojo.declare("dojox.grid.rows", null, {
6 // Stores information about grid rows. Owned by grid and used internally.
7 constructor: function(inGrid){
11 defaultRowHeight: 1, // lines
14 getHeight: function(inRowIndex){
17 getDefaultHeightPx: function(){
19 // retrieves the default row height
20 // returns: int, default row height
22 //return Math.round(this.defaultRowHeight * this.linesToEms * this.grid.contentPixelToEmRatio);
25 prepareStylingRow: function(inRowIndex, inRowNode){
29 odd: Boolean(inRowIndex&1),
30 selected: this.grid.selection.isSelected(inRowIndex),
31 over: this.isOver(inRowIndex),
33 customClasses: "dojoxGrid-row"
36 styleRowNode: function(inRowIndex, inRowNode){
37 var row = this.prepareStylingRow(inRowIndex, inRowNode);
38 this.grid.onStyleRow(row);
39 this.applyStyles(row);
41 applyStyles: function(inRow){
43 node.className = customClasses;
44 var h = node.style.height;
45 dojox.grid.setStyleText(node, customStyles + ';' + (node._style||''));
46 node.style.height = h;
49 updateStyles: function(inRowIndex){
50 this.grid.updateRowStyles(inRowIndex);
53 setOverRow: function(inRowIndex){
54 var last = this.overRow;
55 this.overRow = inRowIndex;
56 if((last!=this.overRow)&&(last >=0)){
57 this.updateStyles(last);
59 this.updateStyles(this.overRow);
61 isOver: function(inRowIndex){
62 return (this.overRow == inRowIndex);