Packagespark.events
Classpublic class GridSortEvent
InheritanceGridSortEvent Inheritance flash.events.Event

Language Version : ActionScript 3.0
Product Version : Flex 4.5
Runtime Versions : Flash Player 10, AIR 2.5

The GridSortEvent class represents events that are dispatched when the data provider of a Spark DataGrid control is sorted as the result of the user clicking on the header of a column in the DataGrid.

See also

spark.components.DataGrid
spark.components.gridClasses.GridColumn
spark.components.GridColumnHeaderGroup


Public Properties
 PropertyDefined By
  columnIndices : Vector.<int>
The vector of column indices of the sorted columns.
GridSortEvent
  newSortFields : Array
The array of ISortFields for this sort.
GridSortEvent
  oldSortFields : Array
[read-only] The array of ISortFields for the last sort.
GridSortEvent
Public Methods
 MethodDefined By
  
GridSortEvent(type:String, bubbles:Boolean, cancelable:Boolean, columnIndices:Vector.<int>, oldSortFields:Array, newSortFields:Array)
Constructor.
GridSortEvent
Public Constants
 ConstantDefined By
  SORT_CHANGE : String = sortChange
[static] The GridSortEvent.SORT_CHANGE constant defines the value of the type property of the event object for a sortChange event, which indicates that a sort filter has just been applied to the grid's dataProvider collection.
GridSortEvent
  SORT_CHANGING : String = sortChanging
[static] The GridSortEvent.SORT_CHANGING constant defines the value of the type property of the event object for a sortChanging event, which indicates that a sort filter is about to be applied to the grid's dataProvider collection.
GridSortEvent
Property Detail
columnIndicesproperty
public var columnIndices:Vector.<int>

Language Version : ActionScript 3.0
Product Version : Flex 4.5
Runtime Versions : Flash Player 10, AIR 2.5

The vector of column indices of the sorted columns. If type is GridSortEvent.SORT_CHANGING this value can be modified and it will be used to update the grid's columnHeaderGroup visibleSortIndicatorIndices.

See also

newSortFieldsproperty 
public var newSortFields:Array

Language Version : ActionScript 3.0
Product Version : Flex 4.5
Runtime Versions : Flash Player 10, AIR 2.5

The array of ISortFields for this sort. If type is GridSortEvent.SORT_CHANGING this value can be modified and it will be used to sort the dataProvider of the grid.

See also

oldSortFieldsproperty 
oldSortFields:Array  [read-only]

Language Version : ActionScript 3.0
Product Version : Flex 4.5
Runtime Versions : Flash Player 10, AIR 2.5

The array of ISortFields for the last sort. This can be null. The elements in this Array should not be modified.


Implementation
    public function get oldSortFields():Array

See also

Constructor Detail
GridSortEvent()Constructor
public function GridSortEvent(type:String, bubbles:Boolean, cancelable:Boolean, columnIndices:Vector.<int>, oldSortFields:Array, newSortFields:Array)

Language Version : ActionScript 3.0
Product Version : Flex 4.5
Runtime Versions : Flash Player 10, AIR 2.5

Constructor.

Parameters
type:String — The event type; indicates the action that caused the event.
 
bubbles:Boolean — Specifies whether the event can bubble up the display list hierarchy.
 
cancelable:Boolean — Specifies whether the behavior associated with the event can be prevented.
 
columnIndices:Vector.<int> — The vector of column indices of the sorted columns.
 
oldSortFields:Array — The array of ISortFields for the last sort.
 
newSortFields:Array — The array of ISortFields for this sort.
Constant Detail
SORT_CHANGEConstant
public static const SORT_CHANGE:String = sortChange

Language Version : ActionScript 3.0
Product Version : Flex 4.5
Runtime Versions : Flash Player 10, AIR 2.5

The GridSortEvent.SORT_CHANGE constant defines the value of the type property of the event object for a sortChange event, which indicates that a sort filter has just been applied to the grid's dataProvider collection.

Typically, if a column header mouse click triggered the sort, then the last index of columnIndices is the column's index. Note that interactive sorts are not necessarily triggered by a mouse click.

This event is dispatched when the user interacts with the control. When you sort the data provider's collection programmatically, the component does not dispatch the sortChange event.

The properties of the event object have the following values:

PropertyValue
bubblesfalse
cancelablefalse
columnIndicesThe vector of column indices of the sorted columns.
currentTargetThe Object that defines the event listener that handles the event. For example, if you use myDataGrid.addEventListener() to register an event listener, myDataGrid is the value of the currentTarget.
newSortFieldsThe array of ISortFields for this sort.
oldSortFieldsThe array of ISortFields for the last sort.
targetThe Object that dispatched the event; it is not always the Object listening for the event. Use the currentTarget property to always access the Object listening for the event.
typeGridSortEvent.SORT_CHANGE

See also

SORT_CHANGINGConstant 
public static const SORT_CHANGING:String = sortChanging

Language Version : ActionScript 3.0
Product Version : Flex 4.5
Runtime Versions : Flash Player 10, AIR 2.5

The GridSortEvent.SORT_CHANGING constant defines the value of the type property of the event object for a sortChanging event, which indicates that a sort filter is about to be applied to the grid's dataProvider collection. Call preventDefault() on this event to prevent the sort from occurring or you modify columnIndices and newSortFields if you want to change the default behavior of the sort.

Typically, if a column header mouse click triggered the sort, then the last index of columnIndices is the column's index. Note that interactive sorts are not necessarily triggered by a mouse click.

This event is dispatched when the user interacts with the control. When you sort the data provider's collection programmatically, the component does not dispatch the sortChanging event.

The properties of the event object have the following values:

PropertyValue
bubblesfalse
cancelablefalse
columnIndicesThe vector of column indices of the columns to be sorted.
currentTargetThe Object that defines the event listener that handles the event. For example, if you use myDataGrid.addEventListener() to register an event listener, myDataGrid is the value of the currentTarget.
newSortFieldsThe array of ISortFields for this sort.
oldSortFieldsThe array of ISortFields for the last sort.
targetThe Object that dispatched the event; it is not always the Object listening for the event. Use the currentTarget property to always access the Object listening for the event.
typeGridSortEvent.SORT_CHANGING

See also