Monday, February 11, 2013


ExtJS 4 textfield and key events — keydown, keypress and keyup

Generally, when your problem is to validate for the input value for every character entered into the text box, you look for some events which are related to key pressing. So, what are the choices that you have (or you can possibly have)
keydown — Keydown input field event.
keypress — Keypress input field event.
keyup — Keyup input field event.

All these events only fire if enableKeyEvents is set to true in the TextField config.
                                xtype: 'textfield'
,  id: 'txtSearch'
,  fieldLabel: 'Search'
,  enableKeyEvents: true
,  listeners: {
keyup: function(thisField, e)
{
Ext.example.msg("Result","Hi Keyup Event Fired");
}
}


No comments:

Post a Comment

Comment Here..