title: Define listeners in controller ExtJS
body: <p>I have got the <code>tabpanel</code> - it's the <code>main</code> form (view).
  In this <code>tabpanel</code> I define the different tabs - <code>xtype:'panel'</code>.</p>
  
  <p>So, I have one <code>main</code>(controller) , <code>main</code> view and some tabs views.
  The tab's views are referenced in <code>main</code> view.</p>
  
  <p>I want to define listener of <code>activate</code> event of some child's <code>panel</code> in <code>main</code> controller.</p>
  
  <p>How can I do that?</p>
  
  <p>the <code>main</code> controller :</p>
  
  <pre><code>Ext.define('KP.controller.account.apartment.Main', {
      extend: 'Ext.app.Controller',
  
      views: ['account.apartment.Main',
          'account.apartment.Requisites'
      ],
  
      models: ['account.apartment.Requisites'
      ],
      stores: ['account.apartment.Requisites'
      ],
  
  
      init: function () {
  
      }
  });
  </code></pre>
  
  <p>The <code>main</code> view:</p>
  
  <pre><code>Ext.define('KP.view.account.apartment.Main', {
      extend: 'Ext.window.Window',
      alias: 'widget.ApartmentData',
  
      height: 566,
      width: 950,
      activeItem: 0,
      layout: {
          type: 'fit'
      },
      autoShow: false,
  
      initComponent: function() {
          var me = this;
  
          Ext.applyIf(me, {            
              items: [
                  {
                      xtype: 'tabpanel',
                      activeTab: 0,
                      deferredRender: true, 
  
                      items: [                        
  
                          {
                              xtype: 'RequisitesApartment'
                          }
                      ]
                  }
              ]
          });
  
          me.callParent(arguments);
      }
  
  });
  </code></pre>
  
  <p>The child <code>panel</code> RequisitesApartment (view):</p>
  
  <pre><code>Ext.define('KP.view.account.apartment.Requisites', {
      extend: 'Ext.panel.Panel',
      alias: 'widget.RequisitesApartment',
  
  
      id: 'panel_accountrequisites',
      height: 350,
      width: 1124,
      autoScroll: true,
      layout: {
          type: 'fit'
      },
  
  
      listeners: {
          activate: function () {           
                 ....load data....
                 ...this listeners I want to push in 'main' controller...            
          }
      },
  
      initComponent: function () {
          var me = this;
  
          var grid_store = Ext.create('KP.store.account.apartment.Requisites');
  
          Ext.applyIf(me, {
              dockedItems: [
                  {
                      xtype: 'gridpanel',
                      height: 260,
                      autoScroll: true,
                      dock: 'bottom',
                      store: grid_store,
                      id: 'r_gridFlatParams',
                      forceFit: true,
  
  
                      columns: [
                          ...some columns....
                      ],
                      viewConfig: {
                  }
              }
              ]
          });
  
          me.callParent(arguments);
      }
  });
  </code></pre>