Author Topic: Totals row with local filtering  (Read 2536 times)

jeff_b

  • Newbie
  • *
  • Posts: 9
    • View Profile
Totals row with local filtering
« on: February 25, 2016, 12:48:27 am »
Hello.  We are looking to add a row would display the totals for whatever data is currently on display in the grid.  Ex


Data :
{ company:  'company A',  cost: '100' },
{ company:   'abc corp',  cost: '200' }

if the user can filter (its local filtering) the company to just abc corp the cost total would be $200.   With no filter, the total should be 300.

Current fiddle is at : http://jsfiddle.net/bvo4s5vr/   forked from the forum guide. But this is not showing any summary data at all.

I have seen the demo for the Summary row but can not seem to get it functional.

Still working on it http://jsfiddle.net/c3mr0mby/   this has the filter for the company and the total works correctly however the total is not changed when filtered. Is there an on filer that I am missing?
« Last Edit: February 25, 2016, 01:23:07 am by jeff_b »

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Totals row with local filtering
« Reply #1 on: March 01, 2016, 09:13:12 pm »
calculateSummary() should take data from the grid as internal data of grid is different from arrayData while filtering.

Code: [Select]
  $grid.pqGrid("option", "dataModel.data")

http://jsfiddle.net/nvzjr7dn/