Author: konstantin.mishin
Date: 2008-01-09 15:47:32 -0500 (Wed, 09 Jan 2008)
New Revision: 5250
Modified:
branches/3.1.x/ui/scrollableDataTable/src/main/javascript/ClientUI/controls/grid/Grid.js
branches/3.1.x/ui/scrollableDataTable/src/main/javascript/ClientUI/controls/grid/GridBody.js
branches/3.1.x/ui/scrollableDataTable/src/main/javascript/ClientUI/controls/grid/GridFooter.js
branches/3.1.x/ui/scrollableDataTable/src/main/javascript/ClientUI/controls/grid/GridHeader.js
Log:
RF-726
Modified:
branches/3.1.x/ui/scrollableDataTable/src/main/javascript/ClientUI/controls/grid/Grid.js
===================================================================
---
branches/3.1.x/ui/scrollableDataTable/src/main/javascript/ClientUI/controls/grid/Grid.js 2008-01-09
20:44:14 UTC (rev 5249)
+++
branches/3.1.x/ui/scrollableDataTable/src/main/javascript/ClientUI/controls/grid/Grid.js 2008-01-09
20:47:32 UTC (rev 5250)
@@ -71,31 +71,19 @@
var grid = this;
Utils.execOnLoad(
function(){
+ grid.getHeader().updateSize();
+ grid.getBody().updateSize();
+ if(grid.getFooter()) {grid.getFooter().updateSize();}
grid.updateLayout();
},
Utils.Condition.ElementPresent(grid.client_id), 100);
},
updateLayout: function($super) {
- if(!this.controlCreated || this.element.offsetHeight==0) {
- return;
- }
$super();
-
- var header = this.getHeader();
- if(header.element.offsetHeight == 0) {
- header.updateSize();
- this.getBody().updateSize();
- if(this.getFooter()) {this.getFooter().updateSize();}
- }
-
if(this.layout) {
this.layout.updateLayout();
}
- header.updateLayout();
- header.setFakeColumnWidth();
- this.getBody().setFakeColumnWidth();
- if(this.getFooter()) {this.getFooter().setFakeColumnWidth();}
},
getHeader: function() {
return this.layout.getPane(GridLayout_Enum.HEADER);
Modified:
branches/3.1.x/ui/scrollableDataTable/src/main/javascript/ClientUI/controls/grid/GridBody.js
===================================================================
---
branches/3.1.x/ui/scrollableDataTable/src/main/javascript/ClientUI/controls/grid/GridBody.js 2008-01-09
20:44:14 UTC (rev 5249)
+++
branches/3.1.x/ui/scrollableDataTable/src/main/javascript/ClientUI/controls/grid/GridBody.js 2008-01-09
20:47:32 UTC (rev 5250)
@@ -174,15 +174,14 @@
},
updateSize: function() {
- var defHeight = this._calcDefaultRowHeight();
-
- if (isFinite(defHeight)) {
- this.defaultRowHeight = defHeight;
- }
-
var row = this.templNormal.getElement().rows[0];
if(row) {
this.defaultRowHeight = row.cells[0].offsetHeight;
+ } else {
+ var defHeight = this._calcDefaultRowHeight();
+ if (isFinite(defHeight)) {
+ this.defaultRowHeight = defHeight;
+ }
}
//if(ClientUILib.isGecko) {
// this.defaultRowHeight -= this.getBorderWidth("tb") +
this.getPadding("tb");
@@ -249,6 +248,7 @@
}
var scrollPos = Math.min(totalWidth - viewWidth, scrollLeft);
this.grid.adjustScrollPosition(scrollPos);
+ this.setFakeColumnWidth();
},
adjustScrollPosition: function(pos) {
this.templNormal.moveToX(-pos);
Modified:
branches/3.1.x/ui/scrollableDataTable/src/main/javascript/ClientUI/controls/grid/GridFooter.js
===================================================================
---
branches/3.1.x/ui/scrollableDataTable/src/main/javascript/ClientUI/controls/grid/GridFooter.js 2008-01-09
20:44:14 UTC (rev 5249)
+++
branches/3.1.x/ui/scrollableDataTable/src/main/javascript/ClientUI/controls/grid/GridFooter.js 2008-01-09
20:47:32 UTC (rev 5250)
@@ -145,6 +145,7 @@
this.container.setWidth(viewWidth);
this.setWidth(viewWidth);
this.frozenSubstrate.setWidth(frozenContentWidth);
+ this.setFakeColumnWidth();
},
adjustScrollPosition: function(pos) {
this.contentBox.moveToX(this.grid.getColumnsFrozenWidth()-pos);
Modified:
branches/3.1.x/ui/scrollableDataTable/src/main/javascript/ClientUI/controls/grid/GridHeader.js
===================================================================
---
branches/3.1.x/ui/scrollableDataTable/src/main/javascript/ClientUI/controls/grid/GridHeader.js 2008-01-09
20:44:14 UTC (rev 5249)
+++
branches/3.1.x/ui/scrollableDataTable/src/main/javascript/ClientUI/controls/grid/GridHeader.js 2008-01-09
20:47:32 UTC (rev 5250)
@@ -56,7 +56,6 @@
if(!template) {
return false;
}
-
var childs = template.childNodes;
for(var i=0; i<childs.length; i++) {
if(childs[i].tagName && childs[i].tagName.toLowerCase() == "div") {
@@ -121,6 +120,7 @@
var ids = this.grid.options.ids;
var count = this.frozenCells.length;
for(i=0; i<count; i++) {
+ this.trace(i);
cell = this.frozenCells[i];
columns[j] = {
columnId: ids[i],
@@ -137,14 +137,18 @@
sortable: Validators.getBoolean(cell.getAttribute("sortable"), false),
sorted: Validators.getBoolean(cell.getAttribute("sorted"),
"desc")
};
+ this.trace(i+"a");
if(columns[j].sortable)
Event.observe(cell, 'click', eventCellMouseDown);
+ this.trace(i+"a1");
h = cell.offsetHeight;
+ this.trace(i+"a2");
if(h > defaultHeight) defaultHeight = h;
defaultWidth += columns[j].width;
columns[j].object = new ClientUI.common.box.InlineBox(cell, null, true);
+ this.trace(i+"b");
var details = this._getCellElements(j);
// separator
columns[j].sep = new ClientUI.common.box.InlineBox(details[0], null, true);
@@ -161,6 +165,7 @@
//columns[j].sortDesc = new ClientUI.common.box.Box(details[1], null, true);
//columns[j].sortAsc = new ClientUI.common.box.Box(details[2], null, true);
j++;
+ this.trace(i+"c");
}
cols = this.headerRow.getElement().getElementsByTagName("col");
@@ -223,9 +228,13 @@
this.frozenSubstrate = new ClientUI.common.box.Box(this.gridId + ":hs",
this.getElement());
this.frozenSubstrate.getElement().name = this.getElement().id + "HRFrm";
this.frozenSubstrate.setHeight(this.headerRow.element.offsetHeight);
-
+
return true;
},
+ trace: function(s) {
+ window.status = s + ": " + (new Date().getTime()- this._d) + " $$ "
+ window.status;
+ this._d = new Date().getTime();
+ },
_getCellElements: function(column) {
var details = new Array(3);
var clientId = this.grid.getElement().id;
@@ -307,6 +316,7 @@
this.headerFrozenRow.setHeight(height);
this.frozenSubstrate.setWidth(frozenContentWidth);
this.updateHeaders();
+ this.setFakeColumnWidth();
},
getColumns: function() {
return this._columns;