title: ExtJS 4 - please explain Model & Store
body: <p>I am trying to get my head round what appears to be the simplest of things:</p>
  
  <p>I want to load a collection of objects via a JSON-returning server-side call, </p>
  
  <p>why do all these return something unexpected?</p>
  
  <pre><code>&gt; modelStore.data.items[0].Id
  undefined
  &gt; modelStore.data.items[0].getId()
  undefined
  &gt; modelStore.data.items[0].getTitle()
  TypeError: Object [object Object] has no method 'getTitle'
  &gt; modelStore.getById(1)
  null
  &gt; modelStore.getTotalCount()
  1
  &gt; modelStore.first()
  Ext.Class.newClass &lt; should be PegModel??
  </code></pre>
  
  <p><strong>The code:</strong></p>
  
  <pre><code>Ext.define('PegfileApp.model.PegModel', {
  
    extend: 'Ext.data.Model',
  
    fields: ['Id', 'Title'],
  
    //hasMany: {model: 'RootDimension', name: 'rootDimensions'},
  
    proxy:
    {
      type: 'ajax',
      url: 'PegModel',
      timeout: 120000,
      noCache: false,
      reader:
      {
        root: 'PegModel',
        successProperty: 'success'
      }
    }
  });
  
  Ext.define('PegfileApp.store.PegModels', {
    extend: 'Ext.data.Store',
    model: 'PegfileApp.model.PegModel',
    autoLoad: true,
    autoSync: false,
    proxy: {
      type: 'ajax',
      url: 'PegModel',
      reader: {
        type: 'json',
        root: 'PegModels',
        successProperty: 'success'
      }
    }
  });
  </code></pre>
  
  <p><strong>The data:</strong></p>
  
  <pre><code>{"PegModels":[{"Title":"PegModel","Id":1}],"success":true}
  </code></pre>
  
  <p>I understood for each property defined on the Model, we have a corresponding getter: get{PropertyName}()?</p>
  
  <p>Do i need to cast the "Record" somehow to a "Model"?</p>