0
votes

I'm using a dateField component (with editable = true) as an itemEditor in a dataGrid. Interestingly, when editing the textInput part of the dateField it doesn't seem to react to an ESC keydown as I would expect, i.e. reload old dateField value and give up focus. This seems to be standard for most other components, but not for as most other components do.

How would you go about implementing such behavior? I can listen to keydown == escape on the TextInput portion, but just realized that I don't know how to tell dateField to give up focus and politely close - in fact I'm not even sure that's the right strategy (maybe I should work at the DataGrid level???).

any ideas would be greatly appreciated!

thank you

f

1

1 Answers

2
votes

OK, figured it out. In the keydown handler inside the itemEditor class, when dealing with keyCode == Keyboard.ESCAPE,

var adg:AdvancedDataGrid = this.owner as AdvancedDataGrid;
adg.destroyItemEditor();

seems to do the trick.

f