PDA

View Full Version : Set Focus to OK button in Ext.Msg.alert



m.poornachandra
7 Sep 2011, 9:43 PM
I am using Ext.Msg.alert(...), while the alert is poping up, focus is not set to 'OK' button. I need to use mouse to click on 'OK' button. It will be more convenient, if focus moves to OK button by default, so that I can use keyboard 'Enter' button to click on 'OK'.

Thanks in advance.

Uberdude
8 Sep 2011, 1:33 AM
The OK button is focused for me without doing anything extra.

mystarrocks
8 Sep 2011, 1:57 AM
For me too. Could be browser specific, though. I tried with IE7 and Firefox, it works fine.

mitchellsimoens
8 Sep 2011, 5:43 AM
If it isn't, all Buttons have a focus method.

m.poornachandra
8 Sep 2011, 6:20 AM
I am using IE8 (should use IE8 as per requirement) and facing this issue. The scenario is, we are having an editable ComboBox and after user has edited the value, we validate it against a list, if not present then display Ext.Msg.alert('Warning!', '' , function(btn, text) {
if(btn == 'ok') {
//
}
});
But the problem is before using the Msg.alert(...), I should be able to set focus to this button. This is the issue.