defaultOperation

defines the default data operation

string defaultOperation;

Values

  • "sum"
  • "count"
  • "max"
  • "min"
  • Example

    webix.ui({
        view:"pivot", id:"p1",
        defaultOperation:"min",
        structure: {
            rows: ["form", "name"], 
            columns: ["year"],
            values: [
                { name:"oil" }
            ]    
        },
        data:pivot_data
    });


    Default value:

    "sum"
    Details

    Setting custom operation as the default one

    You can also set your custom operation as the default one. Firstly, you need to create this operation:

    $$("p1").operations.operationName = function(data){
        /* your operation here */
    };

    And apply it to Pivot by setting its structure:

    $$("p1").config.defaultOperation = "operationName";
     
    $$("p1").setStructure({
        rows: ["form", "name"], 
        columns: ["year"],
        values: [
            { name:"oil" }
        ]    
    });

    Related sample:  Pivot: Custom Default Operation

    Back to top