Définir les auditeurs dans le contrôleur de ExtJS

J'ai le tabpanel - c'est le main forme (point de vue).
Dans ce tabpanel j'définir les différents onglets - xtype:'panel'.

Donc, j'ai un main(contrôleur) , main vue et certains onglets de la vue.
L'onglet de la vue sont référencés dans main vue.

Je veux définir auditeur de activate cas d'un enfant panel dans main contrôleur.

Comment puis-je le faire?

la main contrôleur :

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 () {

    }
});

La main vue:

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);
    }

});

L'enfant panel RequisitesApartment (point de vue):

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);
    }
});

OriginalL'auteur Oleg | 2012-09-21