Friday, November 2, 2007

Customizing Group label fields when using GroupingCollection

By using the ADG.groupLabelFunction property one can customize the group label displayed for the group nodes. The following example shows how children count can be displayed as part of the group label when the group is closed. The source can be found here.

12 comments:

Frank Sommers said...

Hi,

Your examples are great, but I do you have the source code available, too?

Thanks, and keep these posts coming!!

-- Frank

Frank Sommers said...

I tried to do something similar, but was not able to figure out how to get the summary data in each group.

The groupLabelFunction property requires a function that has the data item and the AdvancedDataGridColumn as parameters. How can I obtain a reference to the total count in each column from inside a groupLablFunction column?

Thanks!

Sreenivas said...

Thanks. I hope to post as many samples as I can generate during my spare time. By using the SummaryRow.summaryPlacement property you can make summary value appear where ever you want to. It can take multiple space separated values as input.

I have posted the source code for most of the samples except for the simple ones. If you need source for some particular sample let me know.

Sreenivas said...

> How can I obtain a reference to the total count in each column from inside a groupLablFunction column?

I didn't get that. Can you elaborate?

Frank Sommers said...

Thanks for your reply! Again, these are great examples.

I'm still not sure how to implement the groupLabelFunction to display the total count for each group.

Inside the:

groupLabelFunction(item:Object, column:AdvancedDataGridColumn() {

}

How can I get the group the item belongs to? Not sure how either the item or column parameters reference the group the item belongs to (or the group count).

Again, thanks, for your help. If you could post the source code for this example, that would answer this question, of course. You could also send that via email to fsommers at autospaces dot com. Thanks!

Anonymous said...
This comment has been removed by the author.
Sreenivas said...

Sorting on the columns will sort other tree columns too. I can't imagine what is not working for you. If you can send me a sample I can take a look.

DEVSACHIN said...

Hi,
I am using groupLabelFunction in my custom Datagrid component. I want to format the display of groupLabel according to its data type. if it is Long datetime value then I want to use dateformatter to change it to MM/DD/YYYY format. But in the first argument (i.e. item:Object), the GroupLabel property has text type of data. So I am usable to detect its data type.
I am using dummy column to show grouping information. So the second argument of GroupLabelfunction( i.e. col:AdvancedDataGridColumn) has no datafield and header text.
Please help me how can I accomplish my work

Unknown said...

The example is exactly what I have been trying to accomplish... to show the count of the children for a closed node.

However, the link to the source code does not relate to this example. It deals with grouping territories and sales estimates.

Can you correct the link to point to the source for this example?

Your posts are tremendously helpful! Thanks...

Sreenivas said...

The source link seems to be correct. The child count is being added in the addChildCount function.

Unknown said...

Hi,

is there any way to apply a style on the group label?

ps: the flash isn't loading anymore.

Sreenivas said...

Have you tried using the styleFunction ?