Hi all,
I have a datagrid and I want to display an item editor (text input) when the mouse is over the cells.
Thanks in advance.
Hi all,
I have a datagrid and I want to display an item editor (text input) when the mouse is over the cells.
Thanks in advance.
You can use editedItemPosition property for this.
Setting this property scrolls the item into view and dispatches the
itemEditBegin
event to open an item editor on the specified item renderer.
Listen to itemRollOver
event and set the editedItemPosition
property from there.
<mx:DataGrid id="dg" itemRollOver="startEdit(event)" other="attributes">
Script:
private function startEdit(event:ListEvent):void
{
var c:Number = event.columnIndex;
var r:Number = event.rowIndex;
dg.editedItemPosition = {columnIndex:c, rowIndex:r};
}