title: ExtJS: focus field
body: <p>I have a window containing a form (formPanel). Users can show this window clicking on a button in an ExtJS environment. I would like that when the user clicks the button to show the window, a specific field inside the form contained by the window will focus (by this I mean that the cursor should move to that field so that the user can insert data without needing to click on the field itself first).</p>
  
  <p>I tried some solutions, but could not get them work. Any hints?</p>
  
  <p>Here is what I tried, using some examples I found... but it does not work as expected. This function() is called by the ExtJS button in my interface:</p>
  
  <pre><code>function openCardForm(IDUser){
  
      //Reset the value of this field which may be still there from the prev. usage
      Ext.getCmp('assignFormCARDNUMBER').reset();
      formAssignCard.getForm().load({ 
          url: 'gen/jsonUser.php',
          params:{IDUser:IDUser},
          waitMsg: 'Loading...'
      });
      //Try to focus the Card field when rendering the form
      Ext.getCmp('assignFormCARDNUMBER').on("render",function(){
          Ext.getCmp('assignFormCARDNUMBER').focus(true,10);
      });
      win.show();
  }
  </code></pre>