title: Extjs 5 XTemplate with JSON store data
body: <p>I need help with my xtemplate and store with proxy. No matter what I am trying, I am stuck in this problem. The xtemplate is only showing data from a store without using a proxy.</p>
  
  <p>Working store:</p>
  
  <pre><code>Ext.create('Ext.data.Store', {
      storeId : 'viewStore',
      model    : 'dataview_model',
      data    : [
          {statistic: '213213', description: 'Hallo'},
          {statistic: '534345', description: 'Alloh'},
     ]
  });
  </code></pre>
  
  <p>Working Xtemplate and data config</p>
  
  <pre><code>    xtype: 'component',
      cls: 'kpi-tiles',
      id: 'statisticsBoxes',
      height: 100,
  
      tpl: [
          '&lt;div class="kpi-meta"&gt;',
              '&lt;tpl for="."&gt;',
                  '&lt;span&gt;',
                      '&lt;div class="statsDiv"&gt;{statistic}&lt;/div&gt; {description}',
                  '&lt;/span&gt;', 
              '&lt;/tpl&gt;',
          '&lt;/div&gt;'
      ],
  
      data: [{
          description: Ext.getStore('statisticsStore').getAt(0).data.statistic,
          statistic: Ext.getStore('viewStore').getAt(0).data.statistic
      },{
          description: Ext.getStore('viewStore').getAt(1).data.description,
          statistic: Ext.getStore('viewStore').getAt(1).data.statistic
      }],
  </code></pre>
  
  <p>But when I am changing the data for the template so it will load data from the Statistics store, the following error occurs in the console.log:  Uncaught TypeError: Cannot read property 'getAt' of undefined.</p>
  
  <p>Data config:  </p>
  
  <pre><code>data: [{
      description: 'the description',
      statistic: Ext.getStore('statisticsStore').getAt(0).data.statistic
  }],
  </code></pre>
  
  <p>Statistics store:</p>
  
  <pre><code>Ext.define('ExecDashboard.store.Statistics', {
  extend: 'Ext.data.Store',
  alias: 'store.statistics',
  storeId: 'statisticsStore',
  model: 'ExecDashboard.model.Statistics',
  
  proxy: {      
      type: 'ajax',
      url: '/statistics',
      reader: 'json'
  }
  });
  </code></pre>
  
  <p>Produces the following JSON:<br>
      [{"statistic":"1"}, {"statistic":"2"}]   </p>
  
  <p>The store is loaded in the viewModel:  </p>
  
  <pre><code>    stores: {
      Statistics: {
          type: 'statistics',
          autoLoad: true
      }
  }
  </code></pre>
  
  <p>I think the problem is that the store is not loaded at that moment. But I don't know how to solve this problem. I know that 'Ext.getStore('statisticsStore').getAt(0).data.statistic' works in the console.log when the store is loaded.</p>