javascript pivot customized view

In this example:

  1. We add 3 new formula based columns for year, quarter and month computed from Shipped Date in initial colModel.

    Purpose of adding these new columns is to group or pivot the same column data by different intervals.

  2. We use pivotCM event to create a new colModel from the auto generated colModel during pivoting. In the new colModel, last row in header i.e., sum(Freight) is removed to present an uncluttered view.