Added 3grids asp & .net examples. ricoQuery.aspx removed, as all AJAX queries in...
[infodrom/rico3] / minsrc / ricoLiveGrid.js
index 93d1b9d..6a5ef63 100644 (file)
@@ -390,32 +390,32 @@ Rico.Buffer.Base.prototype = {
     this.rowcntContent = this.size = this.rows.length;
   },
 
-  printAll: function(exportType) {
+  printAll: function() {
     this.liveGrid.showMsg(Rico.getPhraseById('exportInProgress'));
-    Rico.runLater(10,this,'_printAll',exportType);  // allow message to paint
+    Rico.runLater(10,this,'_printAll');  // allow message to paint
   },
 
 /**
  * Support function for printAll()
  */
-  _printAll: function(exportType) {
+  _printAll: function() {
     this.liveGrid.exportStart();
     this.exportBuffer(this.getRows(0,this.totalRows));
-    this.liveGrid.exportFinish(exportType);
+    this.liveGrid.exportFinish();
   },
 
 /**
  * Copies visible rows to a new window as a simple html table.
  */
-  printVisible: function(exportType) {
+  printVisible: function() {
     this.liveGrid.showMsg(Rico.getPhraseById('exportInProgress'));
-    Rico.runLater(10,this,'_printVisible',exportType);  // allow message to paint
+    Rico.runLater(10,this,'_printVisible');  // allow message to paint
   },
 
-  _printVisible: function(exportType) {
+  _printVisible: function() {
     this.liveGrid.exportStart();
     this.exportBuffer(this.visibleRows());
-    this.liveGrid.exportFinish(exportType);
+    this.liveGrid.exportFinish();
   },
 
 /**
@@ -1054,7 +1054,7 @@ Rico.LiveGridMethods = {
   },
 
   remainingHt: function() {
-    var tabHt;
+    var tabHt=this.outerDiv.offsetHeight;
     var winHt=Rico.windowHeight();
     var margin=Rico.isIE ? 15 : 10;
     // if there is a horizontal scrollbar take it into account
@@ -1062,17 +1062,15 @@ Rico.LiveGridMethods = {
     switch (this.sizeTo) {
       case 'window':
         var divTop=Rico.cumulativeOffset(this.outerDiv).top;
-        tabHt=Math.max(this.tabs[0].offsetHeight,this.tabs[1].offsetHeight);
-        Rico.log("remainingHt, winHt="+winHt+' tabHt='+tabHt+' gridY='+divTop);
-        return winHt-divTop-tabHt-this.options.scrollBarWidth-margin;  // allow for scrollbar and some margin
+        Rico.log("remainingHt/window, winHt="+winHt+' tabHt='+tabHt+' gridY='+divTop);
+        return winHt-divTop-tabHt-margin;  // allow for scrollbar and some margin
       case 'parent':
         var offset=this.offsetFromParent(this.outerDiv);
-        tabHt=Math.max(this.tabs[0].offsetHeight,this.tabs[1].offsetHeight);
         if (Rico.isIE) Rico.hide(this.outerDiv);
-        var parentHt=this.outerDiv.parentNode.offsetHeight;
+        var parentHt=this.outerDiv.parentNode.clientHeight;
         if (Rico.isIE) Rico.show(this.outerDiv);
-        Rico.log("remainingHt, parentHt="+parentHt+' gridY='+offset+' winHt='+winHt+' tabHt='+tabHt);
-        return parentHt - tabHt - offset - this.options.scrollBarWidth;
+        Rico.log("remainingHt/parent, parentHt="+parentHt+' offset='+offset+' tabHt='+tabHt);
+        return parentHt-tabHt-offset-margin;
       case 'data':
       case 'body':
         var bodyHt=Rico.isIE ? document.body.scrollHeight : document.body.offsetHeight;
@@ -1082,11 +1080,10 @@ Rico.LiveGridMethods = {
         Rico.log("remainingHt, winHt="+winHt+' pageHt='+bodyHt+' remHt='+remHt);
         return remHt;
       default:
-        tabHt=Math.max(this.tabs[0].offsetHeight,this.tabs[1].offsetHeight);
         Rico.log("remainingHt, winHt="+winHt+' tabHt='+tabHt);
         if (this.sizeTo.slice(-1)=='%') winHt*=parseFloat(this.sizeTo)/100.0;
         else if (this.sizeTo.slice(-2)=='px') winHt=parseInt(this.sizeTo,10);
-        return winHt-tabHt-this.options.scrollBarWidth-margin;  // allow for scrollbar and some margin
+        return winHt-tabHt-margin;  // allow for scrollbar and some margin
     }
   },
 
@@ -1282,6 +1279,7 @@ Rico.LiveGridMethods = {
     }
     var self=this;
     this.menu.showmenu(e,function() { self.closeMenu(); });
+    return false;
   },
 
   closeMenu: function() {
@@ -1562,8 +1560,7 @@ Rico.LiveGridMethods = {
   },
 
   unhighlightCell: function(cell) {
-    if (cell==null) return;
-    Rico.removeClass(cell,this.options.highlightClass);
+    if (cell) Rico.removeClass(cell,this.options.highlightClass);
   },
 
   selectRow: function(r) {