PDA

View Full Version : Add an accesskey to a TextField



eztam
4 Nov 2010, 4:51 AM
Hi,
how can I define the accesskey for a TextField?
I couldn't find it in the API.

Thanks eztam!

Condor
4 Nov 2010, 5:11 AM
Wow! 4 years of working with Ext and you're the first one asking for accesskeys!

autoCreate: Ext.apply({accesskey: 'X'}, Ext.form.TextField.prototype.defaultAutoCreate)

eztam
4 Nov 2010, 5:15 AM
I could solve it by adding an afterrender listener which sets the attribute "accesskey".


var myField = new Ext.form.TextField({...});
myField.on({
scope: myField,
afterrender: function() {
this.el.set({accesskey:'A'});
}
});


Thanks Condor, your solution looks better to me...