The GroupingCollection class lets you create grouped data from flat data
for display in the AdvancedDataGrid control.
When you create the instance of the GroupingCollection from your flat data,
you specify the field or fields of the data used to create the hierarchy.
To populate the AdvancedDataGrid control with grouped data,
you create an instance of the GroupingCollection class from your flat data,
and then pass that GroupingCollection instance to the data provider
of the AdvancedDataGrid control.
To specify the grouping fields of your flat data,
you pass a Grouping instance to
the GroupingCollection.grouping property.
The Grouping instance contains an Array of GroupingField instances,
one per grouping field.
The following example uses the GroupingCollection class to define
two grouping fields: Region and Territory.
This Class has been deprecated and replaced by a new Class
GroupingCollection2 which provide faster,
improved performance and a new summary calculation mechanism.
Class SummaryField has also been deprecated and
replaced by a new Class SummaryField2.
Properties operation and summaryFunction are
not present in the Class SummaryField2.
A new property summaryOperation is introduced in
SummaryField2.
Specifies the Grouping instance applied to the source data.
Setting the grouping property
does not automatically refresh the view,
so you must call the refresh() method
after setting this property.
Implementation public function get grouping():Grouping public function set grouping(value:Grouping):void
The source collection containing the flat data to be grouped.
If the source is not a collection, it will be auto-wrapped into a collection.
Implementation public function get source():Object public function set source(value:Object):void
summaries
property
public var summaries:Array
Language Version :
ActionScript 3.0
Product Version :
Flex 3
Runtime Versions :
Flash Player 9, AIR 1.1
Array of SummaryRow instances that define any root-level data summaries.
Specify one or more SummaryRow instances to define the data summaries,
as the following example shows:
The timer which is associated with an asynchronous refresh operation.
You can use it to change the timing interval, pause the refresh,
or perform other actions.
The default value for the delay property of the
Timer instance is 1, corresponding to 1 millisecond.
Constructor Detail
GroupingCollection
()
Constructor
public function GroupingCollection()
Language Version :
ActionScript 3.0
Product Version :
Flex 3
Runtime Versions :
Flash Player 9, AIR 1.1
Constructor.
Method Detail
cancelRefresh
()
method
public function cancelRefresh():void
Language Version :
ActionScript 3.0
Product Version :
Flex 3
Runtime Versions :
Flash Player 9, AIR 1.1
If the refresh is performed asynchronously,
cancels the refresh operation and stops the building of the groups.
This method only cancels the refresh
if it is initiated by a call to the refresh() method
with an argument of true, corresponding to an asynchronous refresh.
getParent
()
method
protected function getParent(node:Object):*
Language Version :
ActionScript 3.0
Product Version :
Flex 3
Runtime Versions :
Flash Player 9, AIR 1.1
Returns the parent of a node.
The parent of a top-level node is null.
Parameters
node:Object — The Object that defines the node.
Returns
* — The parent node containing the node as child,
null for a top-level node,
and undefined if the parent cannot be determined.
getRoot
()
method
override public function getRoot():Object
Language Version :
ActionScript 3.0
Product Version :
Flex 3
Runtime Versions :
Flash Player 9, AIR 1.1
Return super.source, if the grouping property is set,
and an ICollectionView instance that refers to super.source if not.
Returns
Object — The object to return.
refresh
()
method
public function refresh(async:Boolean = false):Boolean
Language Version :
ActionScript 3.0
Product Version :
Flex 3
Runtime Versions :
Flash Player 9, AIR 1.1
Applies the grouping to the view.
The IGroupingCollection does not detect changes to a group
automatically, so you must call the refresh()
method to update the view after setting the group property.
The refresh() method can be applied asynchronously
by calling refresh(true).
When refresh() is called synchronously,
a client should wait for a CollectionEvent event
with the value of the kind property set
to CollectionEventKind.REFRESH
to ensure that the refresh() method completed.
Parameters
async:Boolean (default = false) — If true, defines the refresh to be asynchronous.
By default it is false denoting synchronous refresh.
Returns
Boolean — true if the refresh() method completed,
and false if the refresh is incomplete,
which can mean that items are still pending.