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")           }                                                           });

Related samples

Details

The customFormat function takes two parameters:

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