Author: konstantin.mishin
Date: 2008-09-02 12:44:46 -0400 (Tue, 02 Sep 2008)
New Revision: 10278
Modified:
trunk/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/ScrollableDataTableBaseRenderer.java
trunk/ui/scrollableDataTable/src/main/javascript/ClientUI/controls/grid/GridBody.js
Log:
RF-4367
Modified:
trunk/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/ScrollableDataTableBaseRenderer.java
===================================================================
---
trunk/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/ScrollableDataTableBaseRenderer.java 2008-09-02
16:27:38 UTC (rev 10277)
+++
trunk/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/ScrollableDataTableBaseRenderer.java 2008-09-02
16:44:46 UTC (rev 10278)
@@ -646,14 +646,11 @@
String options = (String)parameters.get(s_id);
grid.setScrollPos(options);
if(options.length() > 0){
- grid.setFirst(Integer.parseInt(options.split(",")[1]));
+ String[] si = options.split(",");
+ grid.setFirst(Integer.parseInt(si[1]));
+ component.getAttributes().put(ScrollableDataTableUtils.CLIENT_ROW_KEY,
Integer.parseInt(si[3]));
}
}
- int value = 0;
- if (grid.getRows() != 0) {
- value = grid.getFirst() % grid.getRows();
- }
- component.getAttributes().put(ScrollableDataTableUtils.CLIENT_ROW_KEY, value);
composite.decode(context, component);
Modified:
trunk/ui/scrollableDataTable/src/main/javascript/ClientUI/controls/grid/GridBody.js
===================================================================
---
trunk/ui/scrollableDataTable/src/main/javascript/ClientUI/controls/grid/GridBody.js 2008-09-02
16:27:38 UTC (rev 10277)
+++
trunk/ui/scrollableDataTable/src/main/javascript/ClientUI/controls/grid/GridBody.js 2008-09-02
16:44:46 UTC (rev 10278)
@@ -335,7 +335,8 @@
var startRowIndx = 0;
var countToLoad = 0;
- this.scrollInput.value = task.pos + "," + this.currRange.start +
"," + this.currRange.end;
+ var firstIndex = this._getRowIndex(this.templNormal.getElement().rows[0].id);
+ this.scrollInput.value = task.pos + "," + this.currRange.start +
"," + this.currRange.end+ "," + firstIndex;
// if we have intersepted ranges than rearrange rows
// in other case just move rows table to first position
@@ -345,7 +346,7 @@
}
if(switchType === 0) {
- startRowIndx = this._getRowIndex(this.templNormal.getElement().rows[0].id);
+ startRowIndx = firstIndex;
startIndex = range.start;
countToLoad = range.end - range.start;
}
@@ -358,7 +359,7 @@
switchType = 1;
countToLoad = range.start - this.currRange.start;
if(countToLoad > 0) {
- startRowIndx = this._getRowIndex(normalTbl.rows[0].id);
+ startRowIndx = firstIndex;
startIndex = this.currRange.end;
}
}
@@ -392,7 +393,7 @@
ClientUILib.log(ClientUILogger.WARNING, "Start loading: index: " +
startIndex + ", and startRow: " + startRowIndx + ", and count: " +
countToLoad);
this.currRange = range;
this.currentPos = task.pos;
- this.scrollInput.value = task.pos + "," + this.currRange.start +
"," + this.currRange.end;
+ this.scrollInput.value = task.pos + "," + this.currRange.start +
"," + this.currRange.end+ "," + firstIndex;
if (this.grid.options.hideWhenScrolling) {
@@ -725,14 +726,15 @@
},
updateScrollState: function() {
- var value = ($(this.gridId + ":si")).value
- if (value !='' && this.currRange.end >= Number(value)) {
+ this.scrollInput = $(this.gridId + ":si");
+ var value = this.scrollInput.value;
+ if (value !='' && this.currRange.end >=
Number(value.split(',')[2])) {
this.restoreScrollState();
}
+ this.scrollInput.value = this.currentPos + "," + this.currRange.start +
"," + this.currRange.end+ "," +
this._getRowIndex(this.templNormal.getElement().rows[0].id);
},
restoreScrollState: function() {
- this.scrollInput = $(this.gridId + ":si");
var value = this.scrollInput.value;
if(value !=''){
var values = value.split(',');
Show replies by date