title: Form validation via model in extjs 5
body: <p>I am exploring extjs 5 form validation with model validators. I'd like the form to show errors from the the PersonModel.</p>
  
  <p>This is a simple form which creates and saves and Person instance.</p>
  
  <p>How can I hook up model, model view and view to achieve this?</p>
  
  <p>Thanks</p>
  
  <pre><code>Ext.application({
      name: 'Fiddle',
  
      launch: function() {
  
          Ext.define('PersonModel', {
              extend: 'Ext.data.Model',
              fields: [{
                  name: 'fullName',
                  type: 'string',
                  validators: [{
                      type: 'presence'
                  }]
              }]
          });
  
          Ext.define('PersonViewModel', {
              extend: 'Ext.app.ViewModel'
          });
  
          // Form should show the required (presence) field validators as errors
          // when create button is clicked since formBind = true
          // I want form to use the model field validators, I don't want to
          // put validators in form
          //
          // How do I hook up view, viewmodel and model for this ????
          //
          Ext.define('PersonFormView', {
              extend: 'Ext.form.Panel',
              modelValidation: true,
              viewModel: {
                  type: 'PesonViewModel'
              },
              title: 'Create Person',
              defaultType: 'textfield',
              items: [{
                  fieldLabel: 'Full Name',
                  name: 'fullName',
                  vtype: 'required'
              }],
              buttons: [{
                  text: 'Create',
                  formBind: true,
                  disabled: true,
                  handler: function() {
                      // if valid
                      //  create Person model instance and .save()
                  }
              }]
          });
  
  
          //
          // show form
  
          Ext.create('PersonFormView', {
              renderTo: Ext.getBody()
          })
      }
  });
  </code></pre>