Answered: Extending Ext.field.Text
I've been trying for the better part of an hour to extend Ext.field.Text to do the most SIMPLE thing.
I'm basically trying to replicate a phone number field, that will insert the dashes in between area code, etc...so the number ends up looking like 555-555-1212.
My first thought was to try and use the "listeners" config property on the field itself, but no matter what I do, I cannot get the "keyup" function to fire.
My second thought was to try and extend Ext.field.Text in my own special view class, but I could not get that working either. Sencha kept complaining about an alias to "widget.phonefield".
Does anyone have a working example of this, or any pointers?
Posted by skirtle
Perhaps this could help?
You may also find this helpful:
Without seeing your code it's difficult to judge what the problem around widget.phonefield might be. It sounds like you might be trying to use the class name as an xtype when you should be using the short version of the alias.
Thank you! "enableKeyEvents" is the hidden thing I was looking for. Thought I was going CRAZY.
Now onto trying to see if I can subclass Ext.field.Text in the proper way so Sencha will load it.
Though I understand how you missed it, I think it's a little unfair to call it hidden. It is documented in the keyup event for a text field: