Ext.define("Ext.grid.feature.Summary",{extend:"Ext.grid.feature.AbstractSummary",alias:"feature.summary",dock:undefined,dockedSummaryCls:Ext.baseCSSPrefix+"docked-summary",panelBodyCls:Ext.baseCSSPrefix+"summary-",init:function(b){var c=this,a=c.view;c.callParent(arguments);if(c.dock){b.headerCt.on({afterlayout:c.onStoreUpdate,scope:c});b.on({beforerender:function(){var d=[c.summaryTableCls];if(a.columnLines){d[d.length]=a.ownerCt.colLinesCls}c.summaryBar=b.addDocked({childEls:["innerCt"],renderTpl:['
','','',"
","
"],style:"overflow:hidden",itemId:"summaryBar",cls:[c.dockedSummaryCls,c.dockedSummaryCls+"-"+c.dock],xtype:"component",dock:c.dock,weight:10000000})[0]},afterrender:function(){b.body.addCls(c.panelBodyCls+c.dock);a.mon(a.el,{scroll:c.onViewScroll,scope:c});c.onStoreUpdate()},single:true});b.headerCt.afterComponentLayout=Ext.Function.createSequence(b.headerCt.afterComponentLayout,function(){c.summaryBar.innerCt.setWidth(this.getFullWidth()+Ext.getScrollbarSize().width)})}else{c.view.addFooterFn(c.renderTFoot)}b.on({columnmove:c.onStoreUpdate,scope:c});a.mon(a.store,{update:c.onStoreUpdate,datachanged:c.onStoreUpdate,scope:c})},renderTFoot:function(b,c){var a=b.view,d=a.findFeature("summary");if(d.showSummaryRow){c.push("");d.outputSummaryRecord(d.createSummaryRecord(a),b,c);c.push("")}},vetoEvent:function(a,c,d,b){return !b.getTarget(this.summaryRowSelector)},onViewScroll:function(){this.summaryBar.el.dom.scrollLeft=this.view.el.dom.scrollLeft},createSummaryRecord:function(a){var d=a.headerCt.getVisibleGridColumns(),g={records:a.store.getRange()},f=d.length,c,e,b=this.summaryRecord||(this.summaryRecord=new a.store.model(null,a.id+"-summary-record"));b.beginEdit();for(c=0;c