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


About these ads
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 Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: