Home > Uncategorized > Custom Summary Calculator for Grouping Collection 2

Custom Summary Calculator for Grouping Collection 2

Hi ,

Here is a small implementation of custom summary calculator which can be used with SummaryField2 in GroupoingCollection2 of Advanced data grid.

Most of us know that the default summary calulations are SUM, MAX, MIN, AVG and COUNT.

With the new Grouping Collection one can add a custom summary calculator to calculate the summary of a field.

A sample snippet to illustrate the use is as shown:

var summField:SummaryField2 = new SummaryField2(“price”, new MySummaryCalculator());

OR

var summField:SummaryField2 = new SummaryField2(“price”);

summField.summaryOperation = new MySummaryCalculator();

Here, MySummaryCalculator is the custom summary calculator which implements ISummaryCalculator.

Please find the MySummaryCalculator

and the corresponding  Flex code with grouping collection 🙂

(Look for ADGGC2Test.mxml and MySummaryCalculator.as in the linked site)

The summary calculator here generates the Summary as a PRODUCT of the values in the datafield.

Thanks!

Balaji


Categories: Uncategorized
  1. October 23, 2009 at 10:16 am

    Interesting and informative. But will you write about this one more?

  1. No trackbacks yet.

Leave a comment