Guida di riferimento di ActionScript® 3.0 per la piattaforma Adobe® Flash®
Home  |  Nascondi elenco pacchetti e classi |  Pacchetti  |  Classi  |  Novità  |  Indice  |  Appendici  |  Perché in inglese?
Filtri: Recupero dati dal server...
Recupero dati dal server...
mx.collections 

GroupingCollection  - AS3 Flex

Pacchettomx.collections
Classepublic class GroupingCollection
EreditarietàGroupingCollection Inheritance HierarchicalData Inheritance EventDispatcher Inheritance Object
Implementa IGroupingCollection
Obsoleto da 4.0: Da utilizzare GroupingCollection2

Versione linguaggio: ActionScript 3.0
Versione prodotto: Flex 3
Versioni runtime: Flash Player 9, AIR 1.1

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.

  <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>
  

Sintassi MXMLexpandedNascondi sintassi MXML
The <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.

Proprietà MXML predefinitagrouping

Elementi API correlati



Proprietà pubbliche
 ProprietàDefinito da
 InheritedchildrenField : String
Indicates the field name to be used to detect children objects in a data item.
HierarchicalData
 Inheritedconstructor : Object
Un riferimento all'oggetto classe o alla funzione di costruzione per una determinata istanza di oggetto.
Object
  grouping : Grouping
Specifies the Grouping instance applied to the source data.
GroupingCollection
  source : Object
[override] The source collection containing the flat data to be grouped.
GroupingCollection
  summaries : Array
Array of SummaryRow instances that define any root-level data summaries.
GroupingCollection
Proprietà protette
 ProprietàDefinito da
  timer : flash.utils:Timer
The timer which is associated with an asynchronous refresh operation.
GroupingCollection
Metodi pubblici
 MetodoDefinito da
  
Constructor.
GroupingCollection
 Inherited
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Registra un oggetto listener di eventi con un oggetto EventDispatcher, in modo che il listener riceva la notifica di un evento.
EventDispatcher
  
If the refresh is performed asynchronously, cancels the refresh operation and stops the building of the groups.
GroupingCollection
 Inherited
Returns true if the node can contain children.
HierarchicalData
 Inherited
Invia un evento nel flusso di eventi.
EventDispatcher
 Inherited
Returns an Object representing the node's children.
HierarchicalData
 Inherited
Returns data from a node.
HierarchicalData
  
[override] Return super.source, if the grouping property is set, and an ICollectionView instance that refers to super.source if not.
GroupingCollection
 Inherited
Returns true if the node has children.
HierarchicalData
 Inherited
Verifica se per l'oggetto EventDispatcher sono presenti listener registrati per un tipo specifico di evento.
EventDispatcher
 Inherited
Indica se per un oggetto è definita una proprietà specifica.
Object
 Inherited
Indica se un'istanza della classe Object si trova nella catena di prototipi dell'oggetto specificato come parametro.
Object
 Inherited
Indica se la proprietà specificata esiste ed è enumerabile.
Object
  
refresh(async:Boolean = false):Boolean
Applies the grouping to the view.
GroupingCollection
 Inherited
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
Rimuove un listener dall'oggetto EventDispatcher.
EventDispatcher
 Inherited
Imposta la disponibilità di una proprietà dinamica per le operazioni cicliche.
Object
 Inherited
Restituisce la rappresentazione in formato stringa di questo oggetto, formattato in base alle convenzioni specifiche per le versioni localizzate.
Object
 Inherited
Restituisce la rappresentazione in formato stringa dell'oggetto specificato.
Object
 Inherited
Restituisce il valore di base dell'oggetto specificato.
Object
 Inherited
Verifica se un listener di eventi è registrato con questo oggetto EventDispatcher o qualsiasi suo antenato per il tipo di evento specificato.
EventDispatcher
Metodi protetti
 MetodoDefinito da
  
Returns the parent of a node.
GroupingCollection
Eventi
 Evento Riepilogo Definito da
 Inherited[evento di trasmissione] Inviato quando Flash Player o l'applicazione AIR ottiene lo stato di attivazione del sistema operativo ed entra nello stato attivo.EventDispatcher
 Inherited[evento di trasmissione] Inviato quando Flash Player o l'applicazione AIR perde l'attivazione del sistema operativo e sta entrando nello stato inattivo.EventDispatcher
Descrizione delle proprietà

grouping

proprietà
grouping:Grouping

Versione linguaggio: ActionScript 3.0
Versione prodotto: Flex 3
Versioni runtime: Flash Player 9, AIR 1.1

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.



Implementazione
    public function get grouping():Grouping
    public function set grouping(value:Grouping):void

Elementi API correlati

source

proprietà 
source:Object[override]

Versione linguaggio: ActionScript 3.0
Versione prodotto: Flex 3
Versioni runtime: Flash Player 9, AIR 1.1

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.



Implementazione
    override public function get source():Object
    override public function set source(value:Object):void

summaries

proprietà 
public var summaries:Array

Versione linguaggio: ActionScript 3.0
Versione prodotto: Flex 3
Versioni runtime: 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:

      <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>

Elementi API correlati

timer

proprietà 
protected var timer:flash.utils:Timer

Versione linguaggio: ActionScript 3.0
Versione prodotto: Flex 3
Versioni runtime: Flash Player 9, AIR 1.1

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.

Descrizione della funzione di costruzione

GroupingCollection

()Funzione di costruzione
public function GroupingCollection()

Versione linguaggio: ActionScript 3.0
Versione prodotto: Flex 3
Versioni runtime: Flash Player 9, AIR 1.1

Constructor.

Descrizione dei metodi

cancelRefresh

()metodo
public function cancelRefresh():void

Versione linguaggio: ActionScript 3.0
Versione prodotto: Flex 3
Versioni runtime: 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

()metodo 
protected function getParent(node:Object):*

Versione linguaggio: ActionScript 3.0
Versione prodotto: Flex 3
Versioni runtime: Flash Player 9, AIR 1.1

Returns the parent of a node. The parent of a top-level node is null.

Parametri

node:Object — The Object that defines the node.

Restituisce
* — The parent node containing the node as child, null for a top-level node, and undefined if the parent cannot be determined.

getRoot

()metodo 
override public function getRoot():Object

Versione linguaggio: ActionScript 3.0
Versione prodotto: Flex 3
Versioni runtime: 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.

Restituisce
Object — The object to return.

refresh

()metodo 
public function refresh(async:Boolean = false):Boolean

Versione linguaggio: ActionScript 3.0
Versione prodotto: Flex 3
Versioni runtime: 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.

Parametri

async:Boolean (default = false) — If true, defines the refresh to be asynchronous. By default it is false denoting synchronous refresh.

Restituisce
Booleantrue if the refresh() method completed, and false if the refresh is incomplete, which can mean that items are still pending.




[ X ]Perché in inglese?
Il contenuto della Guida di riferimento di ActionScript 3.0 appare in inglese

Non tutte le parti della Guida di riferimento di ActionScript 3.0 sono tradotte in tutte le lingue. Quando un elemento del linguaggio non è tradotto, viene riportato in inglese. Ad esempio, la classe ga.controls.HelpBox non è tradotta in nessuna lingua. Pertanto, nella versione italiana della guida di riferimento, la descrizione della classe ga.controls.HelpBox è riportata in inglese.