title: Sencha Touch 2 - How to get form values?
body: <p>I've got a Sencha Touch 2 MVC app with a form as a view.
  I'm trying to get it's values from the controller with no success.</p>
  
  <p>How could this be done? I'm posting my view/controller code for this one.</p>
  
  <p>View:</p>
  
  <pre><code>Ext.define('MyApp.view.LoginForm', {
      extend: 'Ext.form.Panel',
      config: {
          fullscreen: true,
          items: [
              {
                  xtype: 'fieldset',
                  title: 'Login',
                  id: 'loginform',
                  items: [
                      {
                          xtype: 'emailfield',
                          name: 'email',
                          label: 'Email'
                      },
                      {
                          xtype: 'passwordfield',
                          name: 'password',
                          label: 'Password'
                      }
                  ]
              },
              {
                  xtype: 'button',
                  width: '50%',
                  text: 'Login',
                  ui: 'confirm',
                  id: 'btnSubmitLogin'
              },
              {
                  xtype: 'toolbar',
                  docked: 'top',
                  title: 'MyApp Mobile'
              }
          ]
      }
  });
  </code></pre>
  
  <p>And the controller:</p>
  
  <pre><code>Ext.define("MyApp.controller.LoginForm", {
      extend: "Ext.app.Controller",
      config: {
          refs: {
              btnSubmitLogin: "#btnSubmitLogin"
          },
          control: {
              btnSubmitLogin: {
                  tap: "onSubmitLogin"
              }
          }
      },
      onSubmitLogin: function () {
          console.log("onSubmitLogin");
          var values = app.views.LoginForm.loginform.getValues();
          TryLogin(values['email'], values['password']);
      },
      launch: function () {
          this.callParent();
          console.log("LoginForm launch");
      },
      init: function () {
          this.callParent();
          console.log("LoginForm init");
      }
  });
  </code></pre>
  
  <p>The code will go up to </p>
  
  <pre><code>console.log("onSubmitLogin");
  </code></pre>
  
  <p>And then stop.</p>
  
  <p>On launch I use this:</p>
  
  <pre><code>var LoginForm = Ext.create("MyApp.view.LoginForm");
  Ext.Viewport.add(LoginForm);
  </code></pre>
  
  <p>So, how can I get the values?</p>
  
  <p>Thanks</p>