title: Including a data Store makes the app not load
body: <p>I can't get my application to work using MVC architecture.</p>
  
  <p>Here is the code:</p>
  
  <h2>app.js</h2>
  
  <pre><code>Ext.application({
      name: CONFIG.APP_NS,
      appFolder: '../js/app',
      autoCreateViewport: true,
  
      /*
      models: ['User'],
  
      stores: ['Users'],
      //*/
  
      controllers: ['Main', 'Tab', 'Import', 'Export', 'Predict', 'Admin']  
  });
  </code></pre>
  
  <h2>Import.js (controller)</h2>
  
  <pre><code>Ext.define(CONFIG.APP_NS+'.controller.Import', {
      extend: 'Ext.app.Controller',
  
      //stores: ['Users'], //Uncommenting this makes the application not load at all
      models: ['User'],
      views: ['Import.Window', 'Import.Toolbar', 'Import.Grid'],
  
      init: function(){
          ...
      },
  
      ...
  });
  </code></pre>
  
  <h2>User.js (model)</h2>
  
  <pre><code>Ext.define(CONFIG.APP_NS+'.model.User', {
      extend: 'Ext.data.Model',
      fields: [
          {name: 'id',            type: 'int'},
          {name: 'username',      type: 'string'},
          {name: 'password',      type: 'string'},
          {name: 'salt',          type: 'string'},
          {name: 'firstName',     type: 'string'},
          {name: 'lastName',      type: 'string'},
          {name: 'email',         type: 'string'},
          {name: 'admin',         type: 'boolean'},
          {name: 'authenticated', type: 'boolean'}
      ],
  
      hasMany: {model: CONFIG.APP_NS+'.model.Roles', name: 'roles'},
  
      proxy: {
          type: 'ajax',
          url: 'model/users',
          reader: {
              type: 'json'
          }
      }
  });
  
  Ext.define(CONFIG.APP_NS+'.model.Roles', {
      extend: 'Ext.data.Model',
  
      fields: [
          {name: 'role',          type: 'string'}
      ],
  
      belongsTo: CONFIG.APP_NS+'.model.User'
  });
  </code></pre>
  
  <h2>Users.js (store)</h2>
  
  <pre><code>Ext.define(CONFIG.APP_NS+'store.Users', {
      extend: 'Ext.data.Store',
      requires: CONFIG.APP_NS+'.model.User',
      model: CONFIG.APP_NS+'.model.User'
  });
  </code></pre>
  
  <h2>Grid.js (view)</h2>
  
  <pre><code>Ext.define(CONFIG.APP_NS+'.view.Import.Grid', {
      extend: 'Ext.grid.Panel',
      alias: 'widget.importgrid',
  
      initComponent: function() {
          this.store = Ext.create('Ext.data.Store', { //Works fine with the code as it is
              model: CONFIG.APP_NS+'.model.User',
              proxy: {
                  type: 'ajax',
                  url: 'model/users',
                  reader: {
                      type: 'json'
                  }
              }
          });
          //*/
          //this.store = Ext.create(CONFIG.APP_NS+'.store.Users', {});
  
          this.columns = [
              {header: 'Name',  dataIndex: 'username',  flex: 1},
              {header: 'Email', dataIndex: 'email', flex: 1}
          ];
  
          this.callParent(arguments);
  
          this.store.load();
      }
  });
  </code></pre>
  
  <p>I have tried almost every combination of <em>stores:</em> in different files possible, nothing seems to do the trick. If I do not include the store anywhere, I get the error <em>Object is not a function</em> (or <em>TypeError: Cannot call method 'on' of undefined</em> if defined outside of the <em>initComponent</em> in the view) somewhere in internal extjs files. It seems that even if I copy the structure from the tutorial examples, it still does not work, so I must be missing something.</p>
  
  <p>What am I doing wrong?</p>
  
  <p>Thank you for your time.</p>
  
  <h2>EDITS:</h2>
  
  <p>I am running this code on Wamp (localhost). The server has both ExtJS4 and Symfony installed and running.</p>
  
  <p>Updated error message.</p>
  
  <p>Fixed a typo in the Model, see comments.</p>