The DataGridEditor contains all the logic and event handling needed to
manage the life cycle of an item editor.
A DataGridEditor is owned by a
specified DataGrid. The owning DataGrid is responsible for calling
initialize() to enable editing and uninitialize() when editing is no
longer needed.
A reference to the item renderer
in the DataGrid control whose item is currently being edited.
From within an event listener for the itemEditBegin
and itemEditEnd events,
you can access the current value of the item being edited
using the editedItemRenderer.data property.
Implementation public function get editedItemRenderer():IVisualElement
editorColumnIndex
property
editorColumnIndex:int [read-only]
Language Version :
ActionScript 3.0
Product Version :
Flex 4.5
Runtime Versions :
Flash Player 9, AIR 1.1
The zero-based column index of the cell that is being edited. The
value is -1 if no cell is being edited.
The default value is -1.
Implementation public function get editorColumnIndex():int
editorRowIndex
property
editorRowIndex:int [read-only]
Language Version :
ActionScript 3.0
Product Version :
Flex 4.5
Runtime Versions :
Flash Player 9, AIR 1.1
The zero-based row index of the cell that is being edited. The
value is -1 if no cell is being edited.
The default value is -1.
Implementation public function get editorRowIndex():int
A reference to the currently active instance of the item editor,
if it exists.
To access the item editor instance and the new item value when an
item is being edited, you use the itemEditorInstance
property. The itemEditorInstance property
is not valid until after the event listener for
the itemEditBegin event executes. Therefore, you typically
only access the itemEditorInstance property from within
the event listener for the itemEditEnd event.
The DataGridColumn.itemEditor property defines the
class of the item editor
and, therefore, the data type of the item editor instance.
public function endItemEditorSession(cancel:Boolean = false):Boolean
Language Version :
ActionScript 3.0
Product Version :
Flex 4.5
Runtime Versions :
Flash Player 10, AIR 2.0
Closes the currently active editor and optionally saves the editor's value
by calling the item editor's save() method. If the cancel parameter is true,
then the editor's cancel() method is called instead.
Parameters
cancel:Boolean (default = false) — if true then the data in the editor is discarded,
otherwise it's saved.
Returns
Boolean — true if the data in the editor was saved, false otherwise.
See also
spark.components.IGridItemEditor
grid_gridMouseWheelHandler
()
method
protected function grid_gridMouseWheelHandler(event:MouseEvent):void
Language Version :
ActionScript 3.0
Product Version :
Flex 4.11
Runtime Versions :
Flash Player 11.8, AIR 3.8
Grid MouseWheel event handler. Used to end the itemeditor when scrolling on the grid.
Default action is to save the edited contents.
Parameters
event:MouseEvent
initialize
()
method
public function initialize():void
Language Version :
ActionScript 3.0
Product Version :
Flex 4.5
Runtime Versions :
Flash Player 10, AIR 2.5
Called by the DataGrid after construction to initialize the editor. No
item editors can be created until after this method is called.
startItemEditorSession
()
method
public function startItemEditorSession(rowIndex:int, columnIndex:int):Boolean
Language Version :
ActionScript 3.0
Product Version :
Flex 4.5
Runtime Versions :
Flash Player 10, AIR 2.5
Start editing a cell for a specified row and column index.
Dispatches a GridItemEditorEvent.GRID_ITEM_EDITOR_SESSION_STARTING
event.
Parameters
rowIndex:int — The zero-based row index of the cell to edit.
columnIndex:int — The zero-based column index of the cell to edit.
Returns
Boolean
uninitialize
()
method
public function uninitialize():void
Language Version :
ActionScript 3.0
Product Version :
Flex 4.5
Runtime Versions :
Flash Player 10, AIR 2.5
The method is called to disable item editing on the DataGrid.