-
19 Jun 2012 2:52 AM #1
AbstractSummary fixes
AbstractSummary fixes
Hi. There are a couple of things I don't like about AbstractSummary, If you agree with me maybe we could easlily fix them.
Version 4.1
1. getColumnValue. I think the check for undefined values should be moved after the renderer has been called.
2. getSummary. I would like to receive the dataIndex (or field) when my custom aggregation function are being called. To do this we only need to pass the field to the aggregate function in Store, this is the same behavior followed in Store when it calls its aggregate function.Code:getColumnValue: function(column, summaryData){ var comp = Ext.getCmp(column.id), value = summaryData[column.dataIndex], renderer = comp.summaryRenderer; if (renderer) { value = renderer.call( comp.scope || this, value, summaryData, column.dataIndex ); } if (!value && value !== 0) { value = '\u00a0'; } return value; },
Please, let me know what you think.Code:getSummary: function(store, type, field, group){ if (type) { if (Ext.isFunction(type)) { return store.aggregate(type, null, group, [field]); } switch (type) { case 'count': return store.count(group); case 'min': return store.min(field, group); case 'max': return store.max(field, group); case 'sum': return store.sum(field, group); case 'average': return store.average(field, group); default: return group ? {} : ''; } } }
Thank you very much.
I have another proposal to modify the Summary class, using the method prepareData from Ext-grid-header-Container instead of that getPrintData, that forces you to use a differente renderer for the summary cells and doesn't allow to modify the metadata, but I think I will open another bug when I have a working solution.Last edited by ExTriqui; 19 Jun 2012 at 2:55 AM. Reason: Code formatting
-
12 Jul 2012 6:32 PM #2
Thanks for the report - your suggestions are great and we've implemented them for the next release!
Don Griffin
Ext JS Development Team Lead
Check the docs. Learn how to (properly) report a framework issue and a Sencha Cmd issue
"Use the source, Luke!"
You found a bug! We've classified it as
a bug in our system.
We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.


Reply With Quote