title: ExtJs 4.2 treepanel
body: <p>I'm stuck creating an example of a tree panel.I only obtain an infinite tree.What am I doing wrong?</p>
  
  <p><strong>MODEL</strong></p>
  
  <pre><code>Ext.define('mdlDocumentosTree', {
  extend: 'Ext.data.Model',
  fields:[
          {name:'id',                 type:'string',      mapping:''},
          {name:'text',               type:'string',      mapping:''},
          {name:'leaf',               type:'boolean',     mapping:''},
          {name:'iconCls',            type:'string',      mapping:''}
  ]
  });
  </code></pre>
  
  <p><strong>STORE</strong></p>
  
  <pre><code>Ext.define('strDocumentosTree', {
  extend: 'Ext.data.TreeStore',
  model:  'mdlDocumentosTree',
  autoLoad: false,
  proxy: {
      type: 'ajax', 
      api: {read: 'some url'},
      reader: {
                  type: 'json',
                  root: 'data',
                  totalProperty: 'total',
                  successProperty: 'success'
      }
  }
  });
  </code></pre>
  
  <p><strong>VIEW</strong></p>
  
  <pre><code>var arbolcarpetas=new Ext.tree.Panel({
          itemId:'arbolcarpetas',
          title:'Archivos del Expediente',
          region:'west',
          width:250,
          collapsible:true,
          border: false,
          autoScroll:true,
          store:almacenDocumentos,
          rootVisible: false
      })
  </code></pre>
  
  <p><strong>CONTROLLER</strong></p>
  
  <p>In the controller I load the tree store with this command:</p>
  
  <pre><code>Ext.ComponentQuery.query('viewFichaDetalle #arbolcarpetas')[0].getStore().load();
  </code></pre>
  
  <p>And the php of the store is:</p>
  
  <pre><code>&lt;?php
  $x=0;
  $nodes = array();
  while($x&lt;10){
      array_push($nodes,array('text'=&gt;"A".$x, 'id'=&gt;$x,'children'=&gt;array('text'=&gt;"A".rand(10,100),'id'=&gt;$x,leaf=&gt;true,'iconCls'=&gt;'icon-excel')));
      $x++;
  }
  echo json_encode($nodes);
  ?&gt;
  </code></pre>
  
  <p>The result is this infinite tree:</p>
  
  <p><a href="https://i.stack.imgur.com/d9ltx.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/d9ltx.jpg" alt="enter image description here"></a></p>
  
  <p>What am I doing wrong?Any clue?</p>