我们可以在extjs中为pivot grid的两列上创建自定义聚合函数吗?
根据pivot.js代码我们可以在extjs中为pivot grid的两列上创建自定义聚合函数吗?,extjs,highcharts,pivot-table,extjs5,pivot-grid,Extjs,Highcharts,Pivot Table,Extjs5,Pivot Grid,根据pivot.js代码 * @param {Array} records Records to process. * @param {String} measure Field to aggregate by. * @param {Ext.pivot.matrix.Base} matrix The matrix object reference. * @param {String} rowGroupKey Key of the left axis item.
* @param {Array} records Records to process.
* @param {String} measure Field to aggregate by.
* @param {Ext.pivot.matrix.Base} matrix The matrix object reference.
* @param {String} rowGroupKey Key of the left axis item.
* @param {String} colGroupKey Key of the top axis item.
*
* @return {Number}
*/
sum: function(records, measure, matrix, rowGroupKey, colGroupKey) {
var length = records.length,
total = 0,
i;
for (i = 0; i < length; i++) {
total += Ext.Number.from(records[i].get(measure), 0);
}
return total;
}
*@param{Array}记录要处理的记录。
*@param{String}要聚合的度量值字段。
*@param{Ext.pivot.matrix.Base}matrix是矩阵对象引用。
*@param{String}rowGroupKey左轴项的键。
*顶部轴项的@param{String}colGroupKey键。
*
*@return{Number}
*/
sum:函数(记录、度量、矩阵、rowGroupKey、colGroupKey){
var length=records.length,
总计=0,
我
对于(i=0;i
如何在此基础上为pivot grid的两列创建自定义聚合函数