PDA

View Full Version : Unable to listen "keypress" on Loadmask component in ExtJS 4.2.3



hariharan.devaraj
19 May 2017, 2:26 AM
Hello,

I like to listen for Enter keypress (keyboard) on Loadmask component, when it is in focus. I wrote below code, which works perfect for ExtJS 5.x but it is not working on ExtJS 4.2.3

Could someone help me.... How to achieve this on ExtJS 4.2.3.

Code :

button.setLoading(true);
if(Ext.isDefined(button.loadMask) && Ext.isDefined(button.loadMask.el)) {
button.loadMask.focus();
button.loadMask.el.on('keypress', onLoadMaskKeyPressEvt, button.loadMask, {ownCmp:button});
}

var onLoadMaskKeyPressEvt = function(button, e, options) {
if(button.getKey() === button.ENTER) {
// Our Logic
}
}

Thanks you in advance !!!

Gary Schlosberg
19 May 2017, 11:03 AM
I don't know off-hand, but it looks like there were indeed changes to Ext.LoadMask between 4.2.3 and 5.0.0:
http://docs.sencha.com/extjs/5.0.0/guides/whats_new/api_diffs/500_diff_changes.html#whats_new-_-api_diffs/500_diff_changes_-_ext_loadmask

hariharan.devaraj
21 May 2017, 8:01 PM
Thanks Gary for your Quick response and information. I'm awake those changes and my understanding is that 'keypress' event doesn't have any update between their version. I'm trying to find the solution to work on ExtJS 4.2.3 version.

Have a great day ahead !!!