小编Ekr*_*ĞUL的帖子

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

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

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功能不起作用

extjs

7
推荐指数
1
解决办法
9365
查看次数

ExtJS 4或4.1 MessageBox自定义按钮

Ext.MessageBox.show({
    title:'Messagebox Title',
    msg: 'Are you sure want to delete?',
    buttons: {yes: "Some Button 1",no: "Some Button 2",cancel: "Some Button 3"}
});
Run Code Online (Sandbox Code Playgroud)

ExtJS 4或4.1不支持此代码.按钮没有显示.

extjs4 extjs4.1

6
推荐指数
2
解决办法
1万
查看次数

标签 统计

extjs ×1

extjs4 ×1

extjs4.1 ×1