adds a custom total operation
name | string | the name of the operation |
operation | function | the logic of the operation |
options | object | an object with operation options: leavesOnly or ids properties (see details) |
$$("pivot").addTotalOperation("wAver", function(values, key, data) {
// make the neccessary calculations and return the resulting value
}, {leavesOnly: true});
This method is applied to the Pivot Table only.
The method creates a custom operation for calculating values for total column and column footers.
The operation function takes the following parameters:
The leavesOnly option takes a boolean value. If set to true, the operation function will take only values of leaves child rows (rows that do not have sub-rows).
The ids option takes a boolean value. If the property is set to true, the operation function will take ids of ungrouped data items as the 4th parameter.