PDA

View Full Version : How to show computed values in grid groupheadertpl



dsrikrishna
24 Mar 2014, 12:10 PM
Hi Team,

I am trying to achieve the following functionality in extjs 4.1.0

Please help on how to show the computed values for each group in its groupheadertpl. These values need to change every time user does a filter on the grid.

48441
-
Srikrishna

Gary Schlosberg
25 Mar 2014, 7:32 AM
Here's a few links that should help get you started:
http://docs.sencha.com/extjs/4.1.0/#!/example/grid/remote-group-summary-grid.html
http://www.sencha.com/forum/showthread.php?134176
http://www.sencha.com/forum/showthread.php?232888

dsrikrishna
26 Mar 2014, 10:37 AM
Thanks Gary! That was a start. I was able to get what i needed.I have achieved it with the following piece of code:
groupHeaderTpl: [ '{name:this.calculateValues}',
{
calculateValues: function(name)
{
var str = //do your calculations here.
return str;
}
}
]

In the above function, where i gave a comment do your calculations here, you can access your store and you will get the property on which the grouping is being done in the name value being passed to the function above. So based on it, we can accomplish what we have set out to do.

Cheers!
Srikrishna Dasu