title: Sencha Touch 2 TreeStore from XML
body: <p>I need help 'cause having problems creating TreeStore from xml (store is for NestedList).
  View Javascript code is the following.</p>
  
  <pre class="lang-js prettyprint-override"><code>{
              xtype: 'nestedlist',
              title: 'Журнал',
              iconCls: 'bookmarks',
              displayField: 'title',
              store: {
                  type: 'tree',
                  model: 'App.model.magazineNumber',
                  root: {
                      leaf: false
                  },
                  proxy: {
                      type: 'ajax',
                      url: 'http://localhost:57648/repo/dataMocks/contentListItems.xml',
                      reader: {
                          type: 'xml',
                          rootProperty: 'items',
                          record: 'magazineNumber'
                      }
                  }
              }
  }
  </code></pre>
  
  <p>Model definition</p>
  
  <pre class="lang-js prettyprint-override"><code>Ext.define('App.model.magazineNumber', {
  extend: 'Ext.data.Model',
  config: {
      fields:
          [
              'title',
              'description',
              {
                  name: 'leaf',
                  defaultValue: false
              }]
  //this doesn't help
  //        , hasMany: [{
  //            model: 'App.model.magazineNumber',
  //            name: 'items'
  //        }]
  //        , belongsTo: 'App.model.magazineNumber'
      }
  });
  </code></pre>
  
  <p>and xml file</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;items&gt;
    &lt;magazineNumber&gt;
      &lt;title&gt;Первый номер&lt;/title&gt;
      &lt;description&gt;Описание первого номера&lt;/description&gt;
      &lt;items&gt;
        &lt;magazineNumber&gt;
          &lt;title&gt;Статья один&lt;/title&gt;
          &lt;description&gt;Описание cтатьи один&lt;/description&gt;
          &lt;contentItemId&gt;1&lt;/contentItemId&gt;
        &lt;/magazineNumber&gt;
        &lt;magazineNumber&gt;
          &lt;title&gt;Статья два&lt;/title&gt;
          &lt;description&gt;Описание cтатьи два&lt;/description&gt;
          &lt;contentItemId&gt;2&lt;/contentItemId&gt;
        &lt;/magazineNumber&gt;
        &lt;magazineNumber&gt;
          &lt;title&gt;Статья три&lt;/title&gt;
          &lt;description&gt;Описание cтатьи три&lt;/description&gt;
          &lt;contentItemId&gt;3&lt;/contentItemId&gt;
        &lt;/magazineNumber&gt;
      &lt;/items&gt;
    &lt;/magazineNumber&gt;
    &lt;magazineNumber&gt;
      &lt;id&gt;5&lt;/id&gt;
      &lt;title&gt;Второй номер&lt;/title&gt;
      &lt;description&gt;Описание второго номера&lt;/description&gt;
      &lt;items&gt;
        &lt;magazineNumber&gt;
          &lt;title&gt;Статья один&lt;/title&gt;
          &lt;description&gt;Описание cтатьи один&lt;/description&gt;
          &lt;contentItemId&gt;4&lt;/contentItemId&gt;
        &lt;/magazineNumber&gt;
        &lt;magazineNumber&gt;
          &lt;title&gt;Статья два&lt;/title&gt;
          &lt;description&gt;Описание cтатьи два&lt;/description&gt;
          &lt;contentItemId&gt;5&lt;/contentItemId&gt;
        &lt;/magazineNumber&gt;
      &lt;/items&gt;
    &lt;/magazineNumber&gt;
  &lt;/items&gt;
  </code></pre>
  
  <p>And Nestedlist shows flat structure (all items at once - 1-st top-level magazineNumber, 3 - children, 2-nd top-level magazineNumber, 3 childred ), however if I tap top-level item (in terms of xml file data) it shows 3 item's children. If tap children - nested list goes back to "flat" view.</p>
  
  <p>Should i use self associated model with other associations config or nested models, should i Add 'items' field to model or change store\proxy config in some way? </p>
  
  <p>Some code samples will be greatly appreciated.</p>
  
  <p>Thanks :)</p>