Author: abelevich
Date: 2007-05-31 13:21:43 -0400 (Thu, 31 May 2007)
New Revision: 964
Modified:
trunk/sandbox/scrollable-grid/src/main/templates/org/richfaces/scrollable-grid-header-cell.jspx
trunk/sandbox/scrollable-grid/src/main/templates/org/richfaces/scrollable-grid.jspx
Log:
Modified:
trunk/sandbox/scrollable-grid/src/main/templates/org/richfaces/scrollable-grid-header-cell.jspx
===================================================================
---
trunk/sandbox/scrollable-grid/src/main/templates/org/richfaces/scrollable-grid-header-cell.jspx 2007-05-31
17:21:30 UTC (rev 963)
+++
trunk/sandbox/scrollable-grid/src/main/templates/org/richfaces/scrollable-grid-header-cell.jspx 2007-05-31
17:21:43 UTC (rev 964)
@@ -6,7 +6,8 @@
xmlns:u="
http://ajax4jsf.org/cdk/u"
xmlns:x="
http://ajax4jsf.org/cdk/x"
xmlns:h="
http://ajax4jsf.org/cdk/headers"
-
xmlns:vcp="http://ajax4jsf.org/cdk/vcp"
+
xmlns:vcp="http://ajax4jsf.org/cdk/vcp"
+
class="org.richfaces.renderkit.html.ScrollableGridHeaderCellRenderer"
component="javax.faces.component.UIComponent"
Modified:
trunk/sandbox/scrollable-grid/src/main/templates/org/richfaces/scrollable-grid.jspx
===================================================================
---
trunk/sandbox/scrollable-grid/src/main/templates/org/richfaces/scrollable-grid.jspx 2007-05-31
17:21:30 UTC (rev 963)
+++
trunk/sandbox/scrollable-grid/src/main/templates/org/richfaces/scrollable-grid.jspx 2007-05-31
17:21:43 UTC (rev 964)
@@ -167,6 +167,13 @@
},
getCurrentOptions: function() {
+ if(!this.curr_options) {
+ this.curr_options = {
+ count: grid.getBody().templFrozen.getElement().rows.length,
+ index: 0,
+ startRow: 0
+ }
+ }
return this.curr_options;
},
@@ -216,7 +223,7 @@
var columns_count = '#{columns_count}';
function onSorted(sortEvent) {
- alert("onSorted column: " + sortEvent.column + " by order: "
+ sortEvent.order + ", row:" + sortEvent.startRow + ", index:" +
sortEvent.index);
+ // alert("onSorted column: " + sortEvent.column + " by order:
" + sortEvent.order + ", row:" + sortEvent.startRow + ", index:"
+ sortEvent.index);
var event = null;
#{this:onSortAjaxUpdate(context,component)}
}
@@ -255,10 +262,39 @@
},
onCompleteGridInvalidation : function(request, event, data){
- var local = dataModel.getCurrentOptions();
- dataModel.eventDataReady.fire(local);
- }
- }
+
+ var theDoc = document;
+ var getEl = theDoc.getElementById;
+ var options = dataModel.getCurrentOptions();
+ var rowCount = grid.getBody().templFrozen.getElement().rows.length;
+ var startRow = options.startRow;
+ var count = options.count;
+ var row, id, rowindex, i;
+ for(i=0; i<count; i++) {
+ rowindex = startRow + i;
+ if(rowindex >= rowCount) rowindex -= rowCount;
+ id = "f:row_" + rowindex;
+ row = request.getElementById(id);
+ if(ClientUILib.isIE) {
+ getEl(id).innerText = row.innerHTML;
+ }
+ else {
+ theDoc.getElementById(id).innerHTML = row.innerHTML;
+ }
+
+ id = "n:row_" + rowindex;
+ row = request.getElementById(id);
+ if(ClientUILib.isIE) {
+ getEl(id).innerText = row.innerHTML;
+ }
+ else {
+ theDoc.getElementById(id).innerHTML = row.innerHTML;
+ }
+ }
+
+ dataModel.eventDataReady.fire(options);
+ }
+ }
}();
#{this:getScriptContributions(context, component)};
Event.observe(window, 'load', #{this:getJavaScriptVarName(context,
component)}.init);