((Apenas para componentes do Flex Data Visualization))
Pacotemx.collections
Classepublic class SummaryField
HerançaSummaryField Inheritance Object

The SummaryField class represents a single property in a SummaryRow instance. Each SummaryRow instance specifies one or more SummayField instances that are used to create a data summary.

Use the dataField property to specify the data field used to generate the summary, the label property to specify the name of the data field created to hold the summary data, and the operation property to specify how to create the summary for numeric fields. You can specify one of the following values: SUM, MIN, MAX, AVG, or COUNT.

The following exemplo creates summary rows based on two fields of the data provider of the AdvancedDataGrid control:

  <mx:AdvancedDataGrid id="myADG" 
    initialize="gc.refresh();"> 
    <mx:dataProvider>
      <mx:GroupingCollection id="gc" source="{dpFlat}">
        <mx:Grouping>
          <mx:GroupingField name="Region">
            <mx:summaries>
              <mx:SummaryRow summaryPlacement="group">
                <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:GroupingField>
          <mx:GroupingField name="Territory">
            <mx:summaries>
              <mx:SummaryRow summaryPlacement="group">
                <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:GroupingField>
        </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>
  

Veja também

mx.controls.AdvancedDataGrid
mx.collections.GroupingField
mx.collections.SummaryRow


Propriedades Públicas
 PropriedadeDefinido por
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
  dataField : String
Data field for which the summary is computed.
SummaryField
  label : String
The property used inside the summary object, an instance of the SummaryObject class, to hold summary information.
SummaryField
  operation : String = "SUM"
The function that should be performed on the children.
SummaryField
 Inheritedprototype : Object
[static] A reference to the prototype object of a class or function object.
Object
  summaryFunction : Function
Specifies a callback function to compute a custom data summary.
SummaryField
Métodos Públicos
 MétodoDefinido por
  
SummaryField(dataField:String = null, operation:String = "SUM")
Constructor.
SummaryField
 Inherited
Indicates whether an object has a specified property defined.
Object
 Inherited
Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter.
Object
 Inherited
Indicates whether the specified property exists and is enumerable.
Object
 Inherited
Sets the availability of a dynamic property for loop operations.
Object
 Inherited
Returns the string representation of the specified object.
Object
 Inherited
Returns the primitive value of the specified object.
Object
Detalhes da propriedade
dataFieldpropriedade
public var dataField:String

Data field for which the summary is computed.

labelpropriedade 
public var label:String

The property used inside the summary object, an instance of the SummaryObject class, to hold summary information.

For exemplo, if you set the label property to "Summary", then the computed summary is placed in a property named "Summary" in the summary object. The property of the SummaryObject instance containing the summary data will appear as below:

{Summary:1000}

Veja também

operationpropriedade 
public var operation:String = "SUM"

The function that should be performed on the children. You can specify one of the following values for numeric fields: SUM, MIN, MAX, AVG, or COUNT.

The default value is SUM.

summaryFunctionpropriedade 
public var summaryFunction:Function

Specifies a callback function to compute a custom data summary.

You use this property with the SummaryRow.summaryObjectFunction property, which defines an instance of the SummaryObject class used to collect summary data for display in the AdvancedDataGrid control.

The function signature should be as follows:

      function mySummaryFunction(iterator:IViewCursor, dataField:String, operation:String):Object

The built-in summary functions for SUM, MIN, MAX, AVG, and COUNT all return a Number containing the summary data.

Veja também

Detalhes do construtor
SummaryField()Construtor
public function SummaryField(dataField:String = null, operation:String = "SUM")

Constructor.

Parâmetros
dataField:String (default = null) — Data field for which the summary is computed.
 
operation:String (default = "SUM") — The function that should be performed on the children. You can specify one of the following values for numeric fields: SUM, MIN, MAX, AVG, or COUNT.