I am working with Flex4 mx:Datagrid, and trying to add rows dynamically.
In my datagrid there are n rows at a given time. The last row contains a text "Click to add row", i.e. when the user clicks on this cell, the cell becomes editable, and the user can add the data. Once he/she presses enter, a new row automatically gets added, with the last cell again containing the text "Click to add row". I have been able to manage this by updating the dataprovider of the datagrid on the "itemEditEnd" event.
The problem I am trying to resolve is the following: In general, when the user edits any cell in the column, and presses enter, the cell in the next row automatically becomes editable. However, since in my case, I am refreshing the dataprovider when the user presses enter, so the last item does not become editable. I tried the following workarounds, but none of them worked:
- calling "createItemEditor" after updateCompete event.
- defining a timer event in "itemEditEnd" function and calling "createItemEditor" after the timer completes.
I am sure I am doing some silly mistake here, but can't find it. Any help would be really appreciated.
Thanks, Kapil