ExtJS TextField单击外部按钮后输入键

Ekr*_*ĞUL 7 extjs

我想在文本字段中调用按钮单击输入功能.

items: [
{
    xtype: 'form',
    id: 'myForm',
    items: [
    {
        xtype: 'textfield',
        id: 'myTextField',
        listeners: {
            specialkey: function(f,e){
                if(e.getKey() == e.ENTER){
                    console.log('Spacial Key = Enter'); // It's working
                    // But i wanna click btnSearch button click event
            }
            }
        }
    }
    ],
    buttons: [
        {
            text: 'Search',
            id: 'btnSearch',
            handlers: function(){
                // bla bla
                // bla bla
                // ...
            }
        }
    ]
}
]

var myform = Ext.getCmp('myForm');
myForm.getForm().submit()
Run Code Online (Sandbox Code Playgroud)

它工作但btnSubmit.click功能不起作用

Ekr*_*ĞUL 1

Ext.getCmp('btnSearch').focus();
Run Code Online (Sandbox Code Playgroud)

我不这么认为,但它对我有用:)

谢谢大家