How can I take the source object in ‘specialkey’ event in ExtJs?
This my controller code:
init: function () {
this.control({
'login textfield[action=enter]': {
specialkey: this.on_KeyPress
}
});
}
.......................
on_KeyPress: function (f, e) {
if (e.getKey() == e.ENTER) {
Ext.Msg.alert('Keys', 'You pressed the Enter key');
*****I want to take 'textfield' object here*******
}
}
Thanks!
The docs show that the parameters passed to the
specialkeyare like so:So you can see that the first parameter is the field on which the event happend.
Thus, in your case:
Would be the textfield object.