Fixed php examples and plugins so no warnings are given with the latest versions...
[infodrom/rico3] / minsrc / ricoLiveGridAjax.js
index f2273b5..44fd353 100644 (file)
@@ -92,7 +92,7 @@ Rico.Buffer.AjaxXMLMethods = {
       page_size: (typeof fetchSize=='number') ? fetchSize : this.totalRows,
       offset: startPos.toString()
     };
-    if (!this.foundRowCount) queryHash['get_total']='true';
+    queryHash[this.liveGrid.actionId]="query";
     if (this.options.requestParameters) {
       for ( var i=0; i < this.options.requestParameters.length; i++ ) {
         var anArg = this.options.requestParameters[i];
@@ -155,6 +155,7 @@ Rico.Buffer.AjaxXMLMethods = {
       this.liveGrid.showMsg(Rico.getPhraseById("httpError",xhr.status));
       return;
     }
+    Rico.log("ajaxUpdate: startPos="+startPos);
     this._responseHandler=this['processResponse'+this.options.fmt.toUpperCase()];
     if (!this._responseHandler(startPos,xhr)) return;
     if (this.options.onAjaxUpdate)
@@ -236,7 +237,6 @@ Rico.Buffer.AjaxXMLMethods = {
   },
 
   dom2jstableStyle: function(rowsElement,firstRow) {
-    var acceptStyle=this.options.acceptStyle;
     Rico.log("dom2jstableStyle start");
     var newRows = [];
     var trs = rowsElement.getElementsByTagName("tr");
@@ -307,8 +307,6 @@ Rico.Buffer.AjaxXMLMethods = {
         this.setTotalRows(eofrow);
         newpos=Math.min(this.liveGrid.topOfLastPage(),offset);
         Rico.log("updateGrid: new rowcnt="+eofrow+" newpos="+newpos);
-        if (lastTotalRows==0 && this.liveGrid.sizeTo=='data')
-          Rico.runLater(100,this.liveGrid,'adjustPageSize');  // FF takes a long time to calc initial size
         this.liveGrid.scrollToRow(newpos);
         if ( this.isInRange(newpos) ) {
           this.liveGrid.refreshContents(newpos);
@@ -471,7 +469,7 @@ Rico.Buffer.AjaxSQLMethods = {
 
   formQueryHashSQL: function(startPos,fetchSize,fmt) {
     var queryHash=this.formQueryHashXML(startPos,fetchSize);
-    queryHash[this.liveGrid.actionId]="query";
+    if (!this.foundRowCount) queryHash['get_total']='true';
     if (fmt) queryHash._fmt=fmt;
 
     // sort
@@ -529,7 +527,7 @@ Rico.Buffer.AjaxSQLMethods = {
         this.startPos = start;
       } else {
         this.rows = this.rows.concat( newRows.slice(0, newRows.length));
-        if (this.attr) this.attr = this.attr.concat( newStyle.slice(0, newStyle.length));
+        if (this.attr && newStyle) this.attr = this.attr.concat( newStyle.slice(0, newStyle.length));
         if (this.rows.length > this.maxBufferSize) {
           var fullSize = this.rows.length;
           this.rows = this.rows.slice(this.rows.length - this.maxBufferSize, this.rows.length);