Check documentation for the latest version of DHTMLX Pivot customFormat Pivot Docs

customFormat

redefines the default formatting of cells values and sets a custom format

function customFormat;

Example

var myPivot = new dhx.Pivot("container", {
    data: dataset,                 
    fields: {
        // initial pivot structure
    },
    fieldList: [      
        // the full list of fields
    ],
    customFormat: function (cellValue, method) {                        if (method === "count") {                                           return cellValue.toLocaleString("de");                      }                                                               return "€ " + cellValue.toLocaleString("de")           }                                                           });

Details

The customFormat() function takes two parameters:

  • cellValue - the value of the cell
  • method - the type of operation that will be applied to data

Related sample:  Custom formatting

See also
Back to top