views:

896

answers:

1

Is there a way to make the default item renderer in a Datagrid look like a text input field?

I just want to tell the user, that he can change the value of this cell.

Thx, Martin

A: 

Hello Martin Not only can you make it look like a text input. You can use the itemRenderer property to make it a text input.

A (very crude) example:

[Bindable]

private var dataProvider:ArrayCollection = new ArrayCollection();

private function onInit() :void

{

var obj:Object = new Object();
obj.text = "hello editable world";
dataProvider.addItem(obj);

}

<mx:DataGrid dataProvider="{dataProvider}">
<mx:columns>
 <mx:DataGridColumn dataField="text" itemRenderer="mx.controls.TextInput"/>
</mx:columns>
</mx:DataGrid>
NielsBjerg