defines an object with custom operations
webix.ui({
view: "pivot",
operations: {
floor: v => v.reduce((acc, a) => acc + Math.floor(a), 0),
},
// config
});
An operation can be defined as an object:
operations: {
multiply: {
handler: (a, b) => a * b,
fields: 2,
hidden: true,
branchMode: "raw"
}
}
If a custom function takes more than two parameters, you should use the complex function to apply it:
operations: {
multiply: (a, b, c) => a*b*c,
},
When defining a new operation make sure to provide a corresponding label for it in locales.
// localized label for new operation
pivot.locales.en = {
floor: "floor",
};