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.
[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.
[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
columnIndices
property
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 columnHeaderGroupvisibleSortIndicatorIndices.
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.
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_CHANGE
Constant
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:
Property
Value
bubbles
false
cancelable
false
columnIndices
The vector of column indices of the
sorted columns.
currentTarget
The 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.
newSortFields
The array of ISortFields for this
sort.
oldSortFields
The array of ISortFields for the
last sort.
target
The 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.
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:
Property
Value
bubbles
false
cancelable
false
columnIndices
The vector of column indices of the
columns to be sorted.
currentTarget
The 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.
newSortFields
The array of ISortFields for this
sort.
oldSortFields
The array of ISortFields for the
last sort.
target
The 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.