Roo/bootstrap/Table.js
[roojs1] / Roo / bootstrap / Table.js
index 7d9a63a..9ee0d06 100644 (file)
@@ -341,7 +341,7 @@ 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());
             }
 
@@ -904,34 +904,6 @@ Roo.extend(Roo.bootstrap.Table, Roo.bootstrap.Component,  {
         
         return footer;
     },
-
-    renderSummaryFooter : function()
-    {
-        var footer = {
-            tag: 'tfoot',
-            cn : []
-        };
-
-        var cm = this.cm;
-        
-        for(var i = 0, len = cm.getColumnCount(); i < len; i++){
-            
-            var config = cm.config[i];
-            
-            var c = {
-                tag: 'td',
-                cls : 'x-fcol-' + i,
-                style : '',
-                html: ''
-            };
-            
-            footer.cn.push(c)
-        }
-        
-        return footer;
-    },
-    
-    
     
     onLoad : function()
     {
@@ -961,6 +933,9 @@ Roo.extend(Roo.bootstrap.Table, Roo.bootstrap.Component,  {
         if(ds.getCount() > 0){
             ds.data.each(function(d,rowIndex){
                 var row =  this.renderRow(cm, ds, rowIndex);
+
+                Roo.log("ROW");
+                Roo.log(row);
                 
                 tbody.createChild(row);
                 
@@ -992,11 +967,27 @@ Roo.extend(Roo.bootstrap.Table, Roo.bootstrap.Component,  {
 
         if(!this.footerShow && this.summaryFooterShow) {
 
+            var row = {
+                tag : 'tr',
+                cn : []
+            };
+            
+            tfoot.createChild(row);
+            
+            var _this = this;
+            
+            if(row.cellObjects.length){
+                Roo.each(row.cellObjects, function(r){
+                    _this.renderCellObject(r);
+                })
+            }
+
             for(var i = 0, len = cm.getColumnCount(); i < len; i++){
         
                 var value = cm.config[i].summaryFooter;
 
                 Roo.log('value [' + i + '] : ' + value);
+                
             }
         }