Can we create a custom aggregate function on two columns for pivot grid in extjs?

364 views Asked by At

As per pivot.js code

* @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;
    }

How do we create custom aggregate function on two columns for pivot grid based on this ?

0

There are 0 answers