[richfaces-svn-commits] JBoss Rich Faces SVN: r1040 - trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/common/utils.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Wed Jun 6 08:55:38 EDT 2007


Author: abelevich
Date: 2007-06-06 08:55:38 -0400 (Wed, 06 Jun 2007)
New Revision: 1040

Modified:
   trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/common/utils/Utils.js
Log:


Modified: trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/common/utils/Utils.js
===================================================================
--- trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/common/utils/Utils.js	2007-06-06 12:55:27 UTC (rev 1039)
+++ trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/common/utils/Utils.js	2007-06-06 12:55:38 UTC (rev 1040)
@@ -1,4 +1,5 @@
 var AjaxUpdater = {
+	
 	updateTr:function(trObj, innerHTML){
 		if(trObj) {
 			if(ClientUILib.isIE) {
@@ -24,5 +25,47 @@
 				trObj.innerHTML = innerHTML;
 			}
 		}
+	},
+	
+	updateRows: function(options,request,grid,clientid){
+		var theDoc = document;
+		var getEl = theDoc.getElementById; 
+		var localOptions = options;
+		var rowCount = grid.getBody().templFrozen.getElement().rows.length;
+		var startRow = localOptions.startRow;
+		var count = localOptions.count;
+		var row, id, rowindex, i, el;
+		var dataModel = grid.dataModel;
+		var baseid = clientid;
+		
+		for(i=0; i<count; i++) {
+			rowindex = startRow + i;
+			if(rowindex >= rowCount){
+				 rowindex -= rowCount;
+			}	 
+			
+			id = baseid + ":f:row_" + rowindex;
+			row = request.getElementById(id);
+						
+			if(ClientUILib.isIE) {
+				el = getEl(id);
+				this.updateTr(el,row.xml);
+			}else {
+				el = theDoc.getElementById(id);
+				this.updateTr(el,row.innerHTML);
+			}
+			
+			id = baseid + ":n:row_" + rowindex;
+			row = request.getElementById(id);
+			if(ClientUILib.isIE) {
+				el = getEl(id);
+				this.updateTr(el,row.xml);
+			}else {
+				el = theDoc.getElementById(id);
+				this.updateTr(el,row.innerHTML);
+			}
+		}
+
+		dataModel.eventDataReady.fire(localOptions);
 	}
 }
\ No newline at end of file




More information about the richfaces-svn-commits mailing list