Author Topic: Edit grandSummaryData after loading or filtering  (Read 2276 times)

Mendrace

  • Pro Deluxe
  • Newbie
  • *
  • Posts: 12
    • View Profile
Edit grandSummaryData after loading or filtering
« on: June 10, 2016, 01:30:22 am »
I have a grid with remote data. For some columns, I use the auto summary function (summary: {type: "sum"}). The group model I use with the setting "grand summary: true".

Is it possible to edit the content of the summary row for specific columns after loading or filtering?

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6309
    • View Profile
Re: Edit grandSummaryData after loading or filtering
« Reply #1 on: June 10, 2016, 07:05:08 pm »
There are various ways and choice depends upon what kind of update you want to make in auto grand summary row:

1) If it's an aggregate, then consider to use inbuilt aggregates or create your own aggregate by extending pq.aggregate and use it in column.summary.type

2) If it's formatting or textual change, use rowInit to make a change:

Code: [Select]
rowInit: function(ui){
        var rd = ui.rowData;
if( rd.pq_grandsummary ){
rd.ContactName = "Hello World";//make your change here.
}
},

3) use of column.render callback to make a change similar to rowInit callback.

Mendrace

  • Pro Deluxe
  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Edit grandSummaryData after loading or filtering
« Reply #2 on: June 12, 2016, 03:08:45 pm »
Ok. Thank you for your help  :)