fix grid height calc
[roojs1] / Roo / bootstrap / panel / Grid.js
index 5434f9e..5f9ea4f 100644 (file)
 
 
 
-Roo.bootstrap.panel.Grid = function(config){
+Roo.bootstrap.panel.Grid = function(config)
+{
     
-  
+      
     this.wrapper = Roo.DomHelper.append(document.body, // wrapper for IE7 strict & safari scroll issue
-        {tag: "div", cls: "x-layout-grid-wrapper x-layout-inactive-content"}, true);
+        {tag: "div", cls: "roo-layout-grid-wrapper roo-layout-inactive-content"}, true);
 
+    config.el = this.wrapper;
+    //this.el = this.wrapper;
+    
+      if (config.container) {
+        // ctor'ed from a Border/panel.grid
+        
+        
+        this.wrapper.setStyle("overflow", "hidden");
+        this.wrapper.addClass('roo-grid-container');
+
+    }
+    
     
     if(config.toolbar){
         var tool_el = this.wrapper.createChild();    
@@ -39,7 +52,7 @@ Roo.bootstrap.panel.Grid = function(config){
     }
     
     Roo.bootstrap.panel.Grid.superclass.constructor.call(this, config);
-    
+    config.grid.scrollBody = true;;
     config.grid.monitorWindowResize = false; // turn off autosizing
     config.grid.autoHeight = false;
     config.grid.autoWidth = false;
@@ -50,9 +63,8 @@ Roo.bootstrap.panel.Grid = function(config){
         // render grid on panel activation (if panel background)
         this.on('activate', function(gp) {
             if (!gp.grid.rendered) {
-                gp.grid.render(el);
-                gp.grid.getGridEl().replaceClass("roo-layout-inactive-content", "roo-layout-component-panel");               
-
+                gp.grid.render(this.wrapper);
+                gp.grid.getGridEl().replaceClass("roo-layout-inactive-content", "roo-layout-component-panel");   
             }
         });
             
@@ -100,15 +112,30 @@ Roo.extend(Roo.bootstrap.panel.Grid, Roo.bootstrap.panel.Content, {
         if(!this.ignoreResize(width, height)){
             var grid = this.grid;
             var size = this.adjustForComponents(width, height);
+            // tfoot is not a footer?
+          
+            
             var gridel = grid.getGridEl();
             gridel.setSize(size.width, size.height);
-            /*
-            var thd = grid.getGridEl().select('thead',true).first();
+            
             var tbd = grid.getGridEl().select('tbody', true).first();
-            if (tbd) {
-                tbd.setSize(width, height - thd.getHeight());
+            var thd = grid.getGridEl().select('thead',true).first();
+            var tbf= grid.getGridEl().select('tfoot', true).first();
+
+            if (tbf) {
+                size.height -= tbf.getHeight();
+            }
+            if (thd) {
+                size.height -= thd.getHeight();
             }
-            */
+            
+            tbd.setSize(size.width, size.height );
+            // this is for the account management tab -seems to work there.
+            var thd = grid.getGridEl().select('thead',true).first();
+            //if (tbd) {
+            //    tbd.setSize(size.width, size.height - thd.getHeight());
+            //}
+             
             grid.autoSize();
         }
     },