Author Topic: How can we update the summary row on check and unchecked of rows or group row?  (Read 2508 times)

EPM Solutions

  • Pro Ultimate
  • Full Member
  • *
  • Posts: 182
    • View Profile
Hello Team,

Our requirement:

We have added check box in each row of grid-

 On checked : The intent of checkbox is to set 0 value of certain checked projects and update the row summary aggregations of all row group level or update the summary row excluding the values of checked project.

 On unchecked : return original value and updated the row summary aggregations as initial or update the summary row as the original values project for all row group level.

Here below I have added a snippet (In on check/uncheck: it is setting value to zero and regaining original but not updating the summary row).

Can You please help us to do it? Please check and reply asap.

Problem URL:
https://next.plnkr.co/edit/K85Ne6vMTGPvhj46?preview
« Last Edit: February 26, 2020, 03:47:02 pm by EPM Solutions »

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6323
    • View Profile
First write custom aggregate to exclude checked rows.

Code: [Select]
  agg.sumCustom = function(arr, col, rows){
    var vals = arr.filter(function(val, i){
      return rows[i].pq_group_cb != true
    })
    return agg.sum(vals, col);
  }

then recalculate summary in check event.

Code: [Select]
check: function(evt, ui){               
      this.Group().summaryT();
},

https://next.plnkr.co/edit/oiEqNlBmXgzk6xNx?preview

EPM Solutions

  • Pro Ultimate
  • Full Member
  • *
  • Posts: 182
    • View Profile
Hello Team,

Amazing,

Thank you for your quick response.

And check the below case and please update on same

Case URL: https://paramquery.com/forum/index.php?topic=3461.0
« Last Edit: February 27, 2020, 06:00:49 pm by EPM Solutions »

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6323
    • View Profile
There is no solution for that one currently.