can someone show me the correct direction to look into.
I have both of these features on the grid and the Summary shows in every grouping but I only want it to show at the bottom for all of the groupings.
can someone show me the correct direction to look into.
I have both of these features on the grid and the Summary shows in every grouping but I only want it to show at the bottom for all of the groupings.
i don't understand the problem. explain better![]()
I want to have the Ext.grid.feature.GroupingSummary with a row that adds a Row of total summary for all the groupings in my Grid View.
Basically the row that Ext.grid.feature.Summary provides...
I have buttons on grid in toolbar that onclick either group the data or ungroup but the totals need to appear always.
And off course the toggle for the summaries.
If you could help would be super please do.
I have the same problem. I want to have one summary row at the bottom of the grid. But adding the summary feature on a grid with grouping places the summary in each group, and at the bottom of the grid. Any solutions?
is what my friend did to make it work
what would you do different ( code is good ).Code:Ext.define( 'BL.view.abstract.grid.feature.Summary', { extend : 'Ext.grid.feature.Summary' ,id : 'blsummary' ,alias : 'feature.blsummary' ,getPrintData: function(index) { if( index ) { var objGrid = Ext.ComponentQuery.query( '#center-container > blgridpanel' ).pop(); var objGroupFeature = objGrid.getView().getFeature( 'blgroupingsummary' ); return objGroupFeature.getPrintData( index ); } return this.callParent(arguments); } ,printSummaryRow: function(index) { if( typeof(index)=='object' ) { if( index.collapsedCls ) { return; } index = undefined; } var inner = this.view.getTableChunker().metaRowTpl.join(''); inner = inner.replace('x-grid-row', 'x-grid-row-summary'); inner = inner.replace('{{id}}', '{gridSummaryValue}'); inner = inner.replace(this.nestedIdRe, '{id$1}'); inner = inner.replace('{[this.embedRowCls()]}', '{rowCls}'); inner = inner.replace('{[this.embedRowAttr()]}', '{rowAttr}'); inner = Ext.create('Ext.XTemplate', inner, { firstOrLastCls: Ext.view.TableChunker.firstOrLastCls }); return inner.applyTemplate({ columns: this.getPrintData(index) }); } // Added "values" argument, for hide grid summary in rows ,closeRows: function() { return '</tpl>{[this.printSummaryRow(values)]}'; } } );
Last edited by igor.astakhov; 15 Jul 2011 at 7:17 PM. Reason: grading
this works for meCode:/* * Start FIX: Summary + Grouping. Without this fix there would be a summary row under each group * http://www.sencha.com/forum/showthread.php?135442-Ext.grid.feature.Summary-amp-amp-Ext.grid.feature.Grouping */ Ext.override(Ext.grid.feature.Summary, { closeRows: function() { return '</tpl>{[this.recursiveCall ? "" : this.printSummaryRow()]}'; } }); Ext.override(Ext.XTemplate, { recurse : function(values, reference) { this.recursiveCall = true; var returnValue = this.apply(reference ? values[reference] : values); this.recursiveCall = false; return returnValue; } }); /* * End FIX: Summary + Grouping. Without this fix there would be a summary row under each group * http://www.sencha.com/forum/showthread.php?135442-Ext.grid.feature.Summary-amp-amp-Ext.grid.feature.Grouping */
A much easier way to get the grid grouping feature:
Also, since I have a different implementation of printSummaryRow for grouping summary, I added this before "var inner = ...";Code:var grouping = this.view.getFeature("grid grouping feature id");
Thanks Igor & Qanik,Code:if (index != undefined) return this.view.getFeature("grid grouping feature id").printSummaryRow(index);
Yaron Yogev
IT Software Developer
hi,
can you post a complete example so that we can unterstand it, thanks