|
|
@@ -212,7 +212,9 @@ Ext.define('saas.view.core.report.ReportPanel', {
|
|
|
return s.hasOwnProperty(name);
|
|
|
})
|
|
|
if (type && d) {
|
|
|
- if (type == 'count') {
|
|
|
+ if(typeof c.mySummaryRenderer == 'function') {
|
|
|
+ c.summaryValue = c.mySummaryRenderer(grid, datas);
|
|
|
+ }else if (type == 'count') {
|
|
|
c.summaryValue = Ext.util.Format.number(d[name], c.format || '0');
|
|
|
} else if (typeof c.summaryRenderer == 'function') {
|
|
|
c.summaryValue = c.summaryRenderer(d[name]);
|
|
|
@@ -222,7 +224,11 @@ Ext.define('saas.view.core.report.ReportPanel', {
|
|
|
c.summaryValue = Ext.util.Format.number(d[name], c.format || '0.00');
|
|
|
}
|
|
|
} else if(type && !d) {
|
|
|
- c.summaryValue = me.getSummaryValue(datas, c);
|
|
|
+ if(typeof c.mySummaryRenderer == 'function') {
|
|
|
+ c.summaryValue = c.mySummaryRenderer(grid, c, datas);
|
|
|
+ }else {
|
|
|
+ c.summaryValue = me.getSummaryValue(datas, c);
|
|
|
+ }
|
|
|
} else {
|
|
|
c.summaryValue = null;
|
|
|
}
|
|
|
@@ -336,7 +342,7 @@ Ext.define('saas.view.core.report.ReportPanel', {
|
|
|
me.initSummaryType(c);
|
|
|
summarys.push({
|
|
|
field: c.dataIndex,
|
|
|
- operation: c.summaryTypeName,
|
|
|
+ operation: c.summaryType == 'last' ? 'sum' : c.summaryType,
|
|
|
});
|
|
|
}
|
|
|
})
|
|
|
@@ -357,6 +363,11 @@ Ext.define('saas.view.core.report.ReportPanel', {
|
|
|
column.summaryType = function (records, values) {
|
|
|
return Ext.Array.sum(values);
|
|
|
}
|
|
|
+ } else if(summaryType == 'last') {
|
|
|
+ column._summaryType = 'last';
|
|
|
+ column.summaryType = function (records, values) {
|
|
|
+ return values[values.length - 1];
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
|