我收到
Uncaught TypeError: Cannot call method 'focus' of undefined
发生在
Ext.Msg.prompt with #myinput closed and then opened **again**.
Ext.getCmp('myinput').focus(); works fine for the first time only. How to set the cursor into `myinput` always?
它仅适用于第一次打开的消息框。
更新:以下是我的核心代码。
Ext.Msg.prompt('',
'Some text description',
function(btn, text) {
},
this,
false,
null,
{ placeHolder: 'Please enter some text here', xtype: 'numberfield', id: 'myinput' }
);
Ext.getCmp('myinput').focus();