I have a datagrid with DateField controls in several columns. The DateField appears when the field is in 'edit' mode and just shows the date text when its in 'render' mode. All well and good.
Now I add two images next to the date control in edit mode. Clicking on them calls functions in the datagridcolumn 'column' to set specific values in the date field. The problem is that the 'get' function in the datagridcolumn editor isn't getting called after these values are set unless I go to another cell, then come back to this cell, then click again! In other words if I force the refresh.
Im using 'destroyItemEditor' to close the datefield. I've tried a variety of methods to force the redraw / invalidate including updating the dataprovider, calling invalidate and even forcing the editor to display in another cell and then back again( even if this had worked it would have been unacceptable ).
One interesting thing to note is that if I add an Alert.Show() before I call 'destroyitemeditor' the field gets updated properly but when the alert closes the editor reappears with the wrong date!
FWIW: here's the answer
instead of calling 'destroyItemEditor' do this:
I'm unclear whether you want the editor to go away when you hit the button or not. If so, should it go to a new cell or just go back to renderer mode? If you want it to move somewhere else, I'd fake a KEY_FOCUS_CHANGE event. Otherwise, I might try sending an ITEM_EDIT_END event. I would not call destroyItemEditor except in response to ITEM_EDIT_END
Flex SDK Developer
Adobe Systems Inc.