PDA

View Full Version : A question of button's focus method



hzmdyz
6 Sep 2007, 6:42 PM
var dialog;

function createDialog() {
if (dialog)
return;

dialog = new Ext.BasicDialog('login-dlg', {
modal : true,
autoTabs : true,
tabTag : 'div',
resizeTabs : true,
width : 435,
height : 235,
shadow : true,
closable : false,
resizable : false,
collapsible : false
});

okBtn = dialog.addButton('Submit', dialog.hide, dialog);
okBtn.focus();

}

the okBtn can not focus,
but if change to okBtn.disable() , the button disabled.

evant
6 Sep 2007, 9:52 PM
You can try:
http://extjs.com/deploy/ext/docs/output/Ext.BasicDialog.html#setDefaultButton