I want to call button click in textfield enter function.
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()
It's working but btnSubmit.click function not working
this code working :
    {
                            fieldLabel : 'Password',
                            name : 'j_password',
                            inputType : 'password',
                            allowBlank : false,
                            listeners : {
                                'render' : function(cmp) {
                                    cmp.getEl().on('keypress', function(e) {
                                        if (e.getKey() == e.ENTER) {
                                            submitform();
                                        }
                                    });
                                }
                            }
   }
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With