| パッケージ | mx.collections |
| クラス | public class GroupingCollection |
| 継承 | GroupingCollection HierarchicalData EventDispatcher Object |
| 実装 | IGroupingCollection |
| 言語バージョン: | ActionScript 3.0 |
| 製品バージョン: | Flex 3 |
| ランタイムバージョン: | Flash Player 9, AIR 1.1 |
グループ化されたデータを AdvancedDataGrid コントロールに格納するには、フラットデータから GroupingCollection クラスのインスタンスを作成し、その GroupingCollection インスタンスを AdvancedDataGrid コントロールのデータプロバイダーに渡します。 フラットデータのグループ化フィールドを指定するには、Grouping インスタンスを GroupingCollection.grouping プロパティに渡します。 Grouping インスタンスには、GroupingField インスタンスの配列が含まれます。配列内の GroupingField インスタンスはグループ化フィールドごとに 1 つずつ存在します。
次の例では、GroupingCollection クラスを使用して Region と Territory という 2 つのグループ化フィールドを定義しています。
<mx:AdvancedDataGrid id="myADG"
<mx:dataProvider>
<mx:GroupingCollection id="gc" source="{dpFlat}">
<mx:grouping>
<mx:Grouping>
<mx:GroupingField name="Region"/>
<mx:GroupingField name="Territory"/>
</mx:Grouping>
</mx:grouping>
</mx:GroupingCollection>
</mx:dataProvider>
<mx:columns>
<mx:AdvancedDataGridColumn dataField="Region"/>
<mx:AdvancedDataGridColumn dataField="Territory"/>
<mx:AdvancedDataGridColumn dataField="Territory_Rep"/>
<mx:AdvancedDataGridColumn dataField="Actual"/>
<mx:AdvancedDataGridColumn dataField="Estimate"/>
</mx:columns>
</mx:AdvancedDataGrid>
MXML シンタックス
MXML シンタックスを隠す<mx.GroupingCollection> inherits all the tag attributes of its superclass,
and defines the following tag attributes:
<mx:GroupingCollection
Properties
grouping="No default"
source="No default"
summaries="No default"
/>
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.
デフォルトの MXML プロパティgrouping
関連する API エレメント
| プロパティ | 定義元 | ||
|---|---|---|---|
![]() | childrenField : String
データアイテム内の子オブジェクトの検出に使用するフィールド名を示します。 | HierarchicalData | |
![]() | constructor : Object
指定されたオブジェクトインスタンスのクラスオブジェクトまたはコンストラクター関数への参照です。 | Object | |
| grouping : Grouping
ソースデータに適用される Grouping インスタンスを指定します。 | GroupingCollection | ||
| source : Object [オーバーライド]
グループ化するフラットデータを含むソースコレクションです。 | GroupingCollection | ||
| summaries : Array
ルートレベルのデータ要約を定義する SummaryRow インスタンスの配列です。 | GroupingCollection | ||
| プロパティ | 定義元 | ||
|---|---|---|---|
| timer : flash.utils:Timer
非同期更新操作に関連付けられたタイマーです。 | GroupingCollection | ||
| メソッド | 定義元 | ||
|---|---|---|---|
コンストラクターです。 | GroupingCollection | ||
![]() | addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
イベントリスナーオブジェクトを EventDispatcher オブジェクトに登録し、リスナーがイベントの通知を受け取るようにします。 | EventDispatcher | |
更新が非同期的に実行される場合、更新操作をキャンセルしてグループの作成を中止します。 | GroupingCollection | ||
![]() |
ノードに子を含めることができる場合は、true を返します。 | HierarchicalData | |
![]() |
イベントをイベントフローに送出します。 | EventDispatcher | |
![]() |
ノードの子を表すオブジェクトを返します。 | HierarchicalData | |
![]() |
ノードからデータを返します。 | HierarchicalData | |
[オーバーライド]
グループ化プロパティが設定されている場合は super.source を返し、設定されていない場合は super.source を参照する ICollectionView インスタンスを返します。 | GroupingCollection | ||
![]() |
ノードに子がある場合は true を返します。 | HierarchicalData | |
![]() |
EventDispatcher オブジェクトに、特定のイベントタイプに対して登録されたリスナーがあるかどうかを確認します。 | EventDispatcher | |
![]() |
オブジェクトに指定されたプロパティが定義されているかどうかを示します。 | Object | |
![]() |
Object クラスのインスタンスが、パラメーターとして指定されたオブジェクトのプロトタイプチェーン内にあるかどうかを示します。 | Object | |
![]() |
指定されたプロパティが存在し、列挙できるかどうかを示します。 | Object | |
グループ化をビューに適用します。 | GroupingCollection | ||
![]() |
EventDispatcher オブジェクトからリスナーを削除します。 | EventDispatcher | |
![]() |
ループ処理に対するダイナミックプロパティの可用性を設定します。 | Object | |
![]() |
ロケール固有の規則に従って書式設定された、このオブジェクトのストリング表現を返します。 | Object | |
![]() |
指定されたオブジェクトのストリング表現を返します。 | Object | |
![]() |
指定されたオブジェクトのプリミティブな値を返します。 | Object | |
![]() |
指定されたイベントタイプについて、この EventDispatcher オブジェクトまたはその祖先にイベントリスナーが登録されているかどうかを確認します。 | EventDispatcher | |
grouping | プロパティ |
grouping:Grouping| 言語バージョン: | ActionScript 3.0 |
| 製品バージョン: | Flex 3 |
| ランタイムバージョン: | Flash Player 9, AIR 1.1 |
ソースデータに適用される Grouping インスタンスを指定します。 grouping プロパティを設定してもビューは自動的には更新されないので、このプロパティを設定した後で refresh() メソッドを呼び出す必要があります。
実装
public function get grouping():Grouping public function set grouping(value:Grouping):void関連する API エレメント
source | プロパティ |
summaries | プロパティ |
public var summaries:Array| 言語バージョン: | ActionScript 3.0 |
| 製品バージョン: | Flex 3 |
| ランタイムバージョン: | Flash Player 9, AIR 1.1 |
ルートレベルのデータ要約を定義する SummaryRow インスタンスの配列です。 1 つまたは複数の SummaryRow インスタンスを指定してデータ要約を定義します。次に例を示します。
<mx:AdvancedDataGrid id="myADG"
width="100%" height="100%"
initialize="gc.refresh();">
<mx:dataProvider>
<mx:GroupingCollection id="gc" source="{dpFlat}">
<mx:summaries>
<mx:SummaryRow summaryPlacement="last">
<mx:fields>
<mx:SummaryField dataField="Actual"
label="Min Actual" operation="MIN"/>
<mx:SummaryField dataField="Actual"
label="Max Actual" operation="MAX"/>
</mx:fields>
</mx:SummaryRow>
</mx:summaries>
<mx:Grouping>
<mx:GroupingField name="Region"/>
<mx:GroupingField name="Territory"/>
</mx:Grouping>
</mx:GroupingCollection>
</mx:dataProvider>
<mx:columns>
<mx:AdvancedDataGridColumn dataField="Region"/>
<mx:AdvancedDataGridColumn dataField="Territory_Rep"
headerText="Territory Rep"/>
<mx:AdvancedDataGridColumn dataField="Actual"/>
<mx:AdvancedDataGridColumn dataField="Estimate"/>
<mx:AdvancedDataGridColumn dataField="Min Actual"/>
<mx:AdvancedDataGridColumn dataField="Max Actual"/>
</mx:columns>
</mx:AdvancedDataGrid>
関連する API エレメント
timer | プロパティ |
protected var timer:flash.utils:Timer| 言語バージョン: | ActionScript 3.0 |
| 製品バージョン: | Flex 3 |
| ランタイムバージョン: | Flash Player 9, AIR 1.1 |
非同期更新操作に関連付けられたタイマーです。 これを使用して、タイミング間隔の変更や更新の一時停止などのアクションを実行できます。 タイマーインスタンスの delay プロパティのデフォルト値は 1 (1 ミリ秒に相当)です。
GroupingCollection | () | コンストラクター |
public function GroupingCollection()| 言語バージョン: | ActionScript 3.0 |
| 製品バージョン: | Flex 3 |
| ランタイムバージョン: | Flash Player 9, AIR 1.1 |
コンストラクターです。
cancelRefresh | () | メソッド |
public function cancelRefresh():void| 言語バージョン: | ActionScript 3.0 |
| 製品バージョン: | Flex 3 |
| ランタイムバージョン: | Flash Player 9, AIR 1.1 |
更新が非同期的に実行される場合、更新操作をキャンセルしてグループの作成を中止します。 このメソッドは、refresh() メソッドを引数 true(非同期更新を表す)を指定して呼び出した場合にのみ、更新をキャンセルします。
getParent | () | メソッド |
getRoot | () | メソッド |
refresh | () | メソッド |
public function refresh(async:Boolean = false):Boolean| 言語バージョン: | ActionScript 3.0 |
| 製品バージョン: | Flex 3 |
| ランタイムバージョン: | Flash Player 9, AIR 1.1 |
グループ化をビューに適用します。 IGroupingCollection は、グループの変更を自動検出しません。したがって、refresh() メソッドを呼び出してビューを更新する前に、group プロパティを設定する必要があります。
refresh() メソッドを非同期的に適用するには、refresh(true) を呼び出します。
refresh() が同期的に呼び出された場合、クライアントは、kind プロパティの値が CollectionEventKind.REFRESH に設定された CollectionEvent イベントを待機して、refresh() メソッドが完了したことを確認する必要があります。
パラメーター
async:Boolean (default = false) — true の場合は更新が非同期になります。 デフォルトは false で、同期的に更新されることを示します。
|
Boolean — true が返されるのは refresh() メソッドが完了した場合です。false が返されるのは更新が完了していない場合です。これはアイテムがまだ保留中であることを意味する場合があります。
|
Tue Jun 12 2018, 10:34 AM Z
MXML シンタックスを表示