Author Topic: Change Grouping Summary type  (Read 338 times)

mikep

  • Pro Ultimate
  • Full Member
  • *
  • Posts: 163
    • View Profile
Change Grouping Summary type
« on: March 24, 2023, 09:32:37 pm »
If I'm grouping by a certain field, I want a field's summary to be sum, otherwise I want it to be avg (summary: { type: "avg" }).
How would I accomplish this?


paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6309
    • View Profile
Re: Change Grouping Summary type
« Reply #1 on: March 27, 2023, 12:50:50 pm »
You can use groupChange event to detect grouping by certain field and set field summary accordingly.

Code: [Select]
groupChange: function(){
alert( this.option('groupModel.dataIndx') );
},