title: ExtJS4: Passing parameters / properties from Treestore to Controller
body: <p>I´m using a simple TreeStore without proxies for building my Menu. Here is a simple Example:</p>
  
  <p><strong>Store:</strong></p>
  
  <pre><code>Ext.define('LT.store.MnuApplication', {
      extend: 'Ext.data.TreeStore',
      root: {
          expanded: true,
          children: [{
              text: "Lists", 
              expanded: true, 
              children: [{
                  text: "Countries", 
                  leaf: true,
              }]
          }]
      }
  });
  </code></pre>
  
  <p>In the controller I´ve added a listener to the "click" event:</p>
  
  <p><strong>Controller:</strong></p>
  
  <pre><code>init: function() {
  
          this.control({
  
              /**
               * Catch the treepanels in the menu accordion
               */
              'menu-main treepanel': {
  
                  itemclick: function (view, record, item, index, event){
  
                      var clickedMnuNode = record;
                      var tabPanel = this.getTabPanel();                   
  
                      // Open tab only if the menu node is a leaf node
                      if (clickedMnuNode.isLeaf()) {
                          tabPanel.add({
                              xtype: clickedMnuNode.raw.loadTabComponent
                          }).show();
                      }
                  }
              }
          });
  
          this.callParent();
  
      }
  </code></pre>
  
  <p>And now to my problem with this solution: I want to define in the TreeStore, which actions should be done by the controller - especially which component should be loaded.</p>
  
  <p><strong>For example I would like that the TreeStore looks like this:</strong></p>
  
  <pre><code>Ext.define('LT.store.MnuApplication', {
      extend: 'Ext.data.TreeStore',
      root: {
          expanded: true,
          children: [{
              text: "Lists", 
              expanded: true, 
              children: [{
                  text: "Countries", 
                  leaf: true,
                  loadComponent: 'country-list',
                  loadTarget: 'tabPanel'
              }]
          }]
      }
  });
  </code></pre>
  
  <p>As you can see I´ve added two new parameters to the Tree Leaf. Now I cann access those datasets via the "RAW" method of the record. But that´s not really a nice solution - isn´t it?</p>
  
  <p>So has anyone an idea for me, how to pass additional parameters (like "loadComponent" or "loadTaget") from my TreeStore to the controller?</p>
  
  <p>Thanks in advance &amp; cheers,
  Michael</p>