How to format group labels in Pivot

I would like to format group labels for the pivot: first columns and top headers.

I tried using the $$("data").config.columns[].template function, but I am unable to guess the data field name/type and to get the .template for the other top headers.

I need to know the data field of each label to apply the correct formatting (e.g. number or data) and keep the level of grouping.

Can anybody help?

Thank you


  • Anybody with this issue?

  • edited October 2020

    Hello @mabiuso ,
    Pivot has onBeforeRender event. This handler receives the pivot configuration object that will be used to initialize the component. Since this handler is called before the pivot is initialized, any modifications done to the initial configuration object will be reflected upon its initialization. In this way, you can change the template in all or in the particular columns so by accessing the header property within the configuration object:

         onBeforeRender: function(config){
               var columns = config.header;
               for(var i=1; i < columns.length; i++){
                     // columns[i]

    Please, check the following snippet:
    For more details, please check the related documentation chapter:

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!