// Copyright 2007. Adobe Systems Incorporated. All Rights Reserved. package fl.events { import flash.events.Event; import fl.events.ListEvent; /** * The DataGridEvent class defines events that are associated with the DataGrid component. * These include the following events: *
DataGridEvent.COLUMN_STRETCH
: dispatched after a user resizes a column horizontally.DataGridEvent.HEADER_RELEASE
: dispatched after the user presses and releases the mouse on a column header.DataGridEvent.ITEM_EDIT_BEGIN
: dispatched when an item is ready to be edited.DataGridEvent.ITEM_EDIT_BEGINNING
: dispatched after the user is prepared to edit an item; this is indicated,
* for example, by the user releasing the mouse button when the mouse is over the item.DataGridEvent.ITEM_EDIT_END
: dispatched when an edit session is ending.DataGridEvent.ITEM_FOCUS_IN
: dispatched after an item receives focus.DataGridEvent.ITEM_FOCUS_OUT
: dispatched after an item loses focus.DataGridEvent.COLUMN_STRETCH
constant defines the value of the type
property
* of a columnStretch
event object.
*
* This event has the following properties:
*Property | Value |
---|---|
bubbles | false |
cancelable | false ; there is no default
* behavior to cancel. |
columnIndex | The zero-based index of the header column
* in the columns array of the DataGrid object. |
currentTarget | The object that is actively processing * the event object with an event listener. |
dataField | The name of the field or property in the data * associated with the column of the item. |
itemRenderer | The header renderer for the column that * was stretched. |
reason | null |
rowIndex | The zero-based index of the item in the * data provider. |
target | The object that dispatched the event. The target is
* not always the object listening for the event. Use the currentTarget
* property to access the object that is listening for the event. |
DataGridEvent.HEADER_RELEASE
constant defines the value of the type
property
* of a headerRelease
event object.
*
* This event has the following properties:
*Property | Value |
---|---|
bubbles | false |
cancelable | false ; there is no default
* behavior to cancel. |
columnIndex | The zero-based index of the header column
* in the columns array of the DataGrid object. |
currentTarget | The object that is actively processing * the event object with an event listener. |
dataField | The name of the field or property in the data * associated with the column of the item. |
itemRenderer | The header renderer that was clicked. |
reason | null |
rowIndex | -1 |
target | The object that dispatched the event. The target is
* not always the object listening for the event. Use the currentTarget
* property to access the object that is listening for the event. |
DataGridEvent.ITEM__EDIT_BEGINNING
constant defines the value of the
* type
property of an itemEditBeginning
event object.
*
* This event has the following properties:
*Property | Value |
---|---|
bubbles | false |
cancelable | false ; there is no default
* behavior to cancel. |
columnIndex | The zero-based index of the header column
* in the columns array of the DataGrid object. |
currentTarget | The object that is actively processing * the event object with an event listener. |
dataField | The name of the field or property in the data * associated with the column of the item. |
itemRenderer | The item renderer for the item to * be edited. |
reason | null |
rowIndex | The zero-based index of the item in the * data provider. |
target | The object that dispatched the event. The target is
* not always the object listening for the event. Use the currentTarget
* property to access the object that is listening for the event. |
DataGridEvent.ITEM_EDIT_BEGIN
constant defines the value of
* the type
property of an itemEditBegin
event object.
*
* This event has the following properties:
*Property | Value |
---|---|
bubbles | false |
cancelable | false ; there is no default
* behavior to cancel. |
columnIndex | The zero-based index of the header column
* in the columns array of the DataGrid object. |
currentTarget | The object that is actively processing * the event object with an event listener. |
dataField | null |
itemRenderer | The item renderer for the item to * be edited. |
reason | null |
rowIndex | The zero-based index of the item in the * data provider. |
target | The object that dispatched the event. The target is
* not always the object listening for the event. Use the currentTarget
* property to access the object that is listening for the event. |
DataGridEvent.ITEM_EDIT_END
constant defines the value of the type
* property of an itemEditEnd
event object.
*
* This event has the following properties:
*Property | Value |
---|---|
bubbles | false |
cancelable | false ; there is no default
* behavior to cancel. |
columnIndex | The zero-based index of the header column
* in the columns array of the DataGrid object. |
currentTarget | The object that is actively processing * the event object with an event listener. |
dataField | The name of the field or property in the data * associated with the column of the item. |
itemRenderer | The item renderer for the item to * be edited. |
reason | A constant defining the reason for the event. The
* value must be a member of the DataGridEventReason class. |
rowIndex | The zero-based index of the item in the * data provider. |
target | The object that dispatched the event. The target is
* not always the object listening for the event. Use the currentTarget
* property to access the object that is listening for the event. |
DataGridEvent.ITEM_FOCUS_IN
constant defines the value of the type
* property of a itemFocusIn
event object.
*
* This event has the following properties:
*Property | Value |
---|---|
bubbles | false |
cancelable | false ; there is no default
* behavior to cancel. |
columnIndex | The zero-based index of the header column
* in the columns array of the DataGrid object. |
currentTarget | The object that is actively processing * the event object with an event listener. |
dataField | null |
itemRenderer | The item renderer for the item to * be edited. |
reason | null |
rowIndex | The zero-based index of the item in the * data provider. |
target | The object that dispatched the event. The target is
* not always the object listening for the event. Use the currentTarget
* property to access the object that is listening for the event. |
DataGridEvent.ITEM_FOCUS_OUT
constant defines the value of the type
* property of an itemFocusOut
event object.
*
* This event has the following properties:
*Property | Value |
---|---|
bubbles | false |
cancelable | false ; there is no default
* behavior to cancel. |
columnIndex | The zero-based index of the header column
* in the columns array of the DataGrid object. |
currentTarget | The object that is actively processing * the event object with an event listener. |
dataField | null |
itemRenderer | The item renderer for the item to * be edited. |
reason | null |
rowIndex | The zero-based index of the item in the * data provider. |
target | The object that dispatched the event. The target is
* not always the object listening for the event. Use the currentTarget
* property to access the object that is listening for the event. |
itemEditEnd
event was dispatched.
* This property is only valid for events of type DataGridEvent.ITEM_EDIT_END
.
* The possible values are defined in the DataGridEventReason class.
* * @see fl.controls.DataGrid#event:itemEditEnd * @see DataGridEventReason * * @langversion 3.0 * @playerversion Flash 9.0.28.0 */ public function get reason():String { return _reason; } /** * Creates a new DataGridEvent object with the specified parameters. * * @param type The event type; this value indicates the action that caused the event. * * @param bubbles Indicates whether the event can bubble up the display list hierarchy. * * @param cancelable Indicates whether the behavior associated with the event can be * prevented. * * @param columnIndex The zero-based index of the column that contains the renderer. * * @param rowIndex The zero-based index of the row that contains the renderer. * * @param itemRenderer The item renderer for the item that is being edited or the header * render that is being clicked or stretched. * * @param dataField The name of the field or property in the data associated with the column. * * @param reason The reason theitemEditEnd
event was dispatched.
*
* @see DataGridEventReason
*
* @langversion 3.0
* @playerversion Flash 9.0.28.0
*/
public function DataGridEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false, columnIndex:int=-1, rowIndex:int=-1, itemRenderer:Object=null, dataField:String=null, reason:String=null) {
super(type, bubbles, cancelable, columnIndex, rowIndex);
_itemRenderer = itemRenderer;
_dataField = dataField;
_reason = reason;
}
/**
* Returns a string that contains all the properties of the DataGridEvent object. The
* string is in the following format:
*
* [DataGridEvent type=value bubbles=value
* cancelable=value columnIndex=value rowIndex=value
* itemRenderer=value dataField=value reason=value
]