Author Topic: Pivot mode Issue  (Read 39 times)

EPM Solutions

  • Pro Ultimate
  • Full Member
  • *
  • Posts: 136
    • View Profile
Pivot mode Issue
« on: April 16, 2019, 07:34:16 pm »
Hello Team,

                 Thanks for your previous reply.

                  In Pivot mode, Why the unwanted columns are appearing on changing the Summary options by clicking on aggregate pane options in Tool Panel in Pivot Mode?

 This issue is coming in pivot mode after applying the groupOption code suggested by yours. I have added a plunker and Image.

Kindly check it and provide a solution as soon as possible.

plunker URL:

https://next.plnkr.co/edit/Ct7jrEcYWOqkY8cT
 
« Last Edit: April 16, 2019, 07:43:25 pm by EPM Solutions »

paramquery

  • Administrator
  • Hero Member
  • *****
  • Posts: 3861
    • View Profile
Re: Pivot mode Issue
« Reply #1 on: April 17, 2019, 09:06:25 am »
Looking into it.

paramquery

  • Administrator
  • Hero Member
  • *****
  • Posts: 3861
    • View Profile
Re: Pivot mode Issue
« Reply #2 on: April 17, 2019, 10:03:41 pm »
Please use this: replace the type of aggregate in this code as per your requirements.

Code: [Select]
groupOption: function(evt, ui){
        debugger;
        var GM = this.option('groupModel'),
          obj = {},
          newPivot = GM.pivot;
       
        //pivot turned on
        if( newPivot && !ui.oldGM.pivot ){
          this.getColModel().forEach(function(col){
            var di = col.dataIndx;
            if(di == "proBudget" || di == 'proOverUnder' ){
              col.summary = {type:'all'};
              obj[di] = "all";
            }
            else{
              col.summary = {};
            }
          })
          this.Group().option({agg: obj}, false);
          //GM.agg = obj;
        }
        //pivot turned off
        else if( !newPivot && ui.oldGM.pivot ){
            this.getColModel().forEach(function(col){
              var di = col.dataIndx;
              col.summary = {type:'all'};
              obj[di] = "all";
            })
            //GM.agg = obj;
            this.Group().option({agg: obj}, false);
        }
        //debugger;
      },

https://stackblitz.com/edit/paramquery-pivot?file=index.html