1

根据 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 {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;
    }

我们如何基于此在枢轴网格的两列上创建自定义聚合函数?

4

0 回答 0