ParamQuery grid support forum

General Category => Help for ParamQuery Grid (free version) => Topic started by: jeff_b on February 25, 2016, 12:48:27 am

Title: Totals row with local filtering
Post by: jeff_b 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?
Title: Re: Totals row with local filtering
Post by: paramvir 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/