View Full Version : setting focus on a container with child text fields

2 Mar 2015, 3:28 PM
I have a component that represents a zip code. It is a container with 2 text fields inside. In my form I am using tabIndex to set focus on the fields in a certain order and skip over fields that aren't usually filled in. How can I get the first field in my zip component to receive focus? I have created a fiddle (https://fiddle.sencha.com/#fiddle/j1j) with this example (I want zip1 to receive focus after Last Name). Thanks in advance.

3 Mar 2015, 11:32 AM
Just use a 'blur' listener on the Last Name field, ie: j34

Obviously you should not use ids and Ext.getCmp() in production but you get the idea... :)