fix #7456 - New_Customer_Portal_100_Report
[roojs1] / roojs-bootstrap-debug.js
index 8f4f9b5..97def3e 100644 (file)
@@ -9157,6 +9157,7 @@ Currently the Table  uses multiple headers to try and handle XL / Medium etc...
  *                also adds table-responsive (see bootstrap docs for details)
  * @cfg {Boolean} loadMask (true|false) default false
  * @cfg {Boolean} footerShow (true|false) generate tfoot, default true
+ * @cfg {Boolean} summaryFooterShow (true|false) generate tfoot for summary, default false
  * @cfg {Boolean} headerShow (true|false) generate thead, default true
  * @cfg {Boolean} rowSelection (true|false) default false
  * @cfg {Boolean} cellSelection (true|false) default false
@@ -9341,6 +9342,7 @@ Roo.extend(Roo.bootstrap.Table, Roo.bootstrap.Component,  {
     store : false,
     loadMask : false,
     footerShow : true,
+    summaryFooterShow : false,
     headerShow : true,
     enableColumnResize: true,
     disableAutoSize: false,
@@ -9416,9 +9418,10 @@ Roo.extend(Roo.bootstrap.Table, Roo.bootstrap.Component,  {
             
             cfg.cn.push(this.renderBody());
             
-            if(this.footerShow){
+            if(this.footerShow || this.summaryFooterShow){
                 cfg.cn.push(this.renderFooter());
             }
+
             // where does this come from?
             //cfg.cls+=  ' TableGrid';
         }
@@ -9979,8 +9982,6 @@ Roo.extend(Roo.bootstrap.Table, Roo.bootstrap.Component,  {
         return footer;
     },
     
-    
-    
     onLoad : function()
     {
 //        Roo.log('ds onload');
@@ -10037,6 +10038,33 @@ Roo.extend(Roo.bootstrap.Table, Roo.bootstrap.Component,  {
                 this.mainFoot.show();
             }
         }
+
+        if(!this.footerShow && this.summaryFooterShow) {
+
+            var tr = {
+                tag : 'tr',
+                cn : []
+            };
+
+            for(var i = 0, len = cm.getColumnCount(); i < len; i++){
+        
+                var value = cm.config[i].summaryFooter;
+
+                var td = {
+                    tag: 'td',
+                    cls : ' x-fcol-' + i,
+                    style: '',
+                    html: cm.config[i].summaryFooter
+                };
+
+                tr.cn.push(td);
+                
+            }
+            
+            tfoot.dom.innerHTML = '';
+
+            tfoot.createChild(tr);
+        }
         
         Roo.each(this.el.select('tbody td', true).elements, function(e){
             e.on('mouseover', _this.onMouseover, _this);