0

Setup: So I have a controller that manages a hierarchy of views. I want my controller to be able to pickup on any events fired within this view hierarchy.

app/view/myView.js

Ext.define('app.view.myView', {
    ...
    alias: 'widget.myview',
    buttons: [{ 
         ...
         handler: function() {
             this.fireEvent('someEvent', this, args); // handler in controller
         },
         ...
    }]
});

app/controller/myController.js

Ext.define('app.controller.myController', {
    ...
    views: ['myView', ...],
    init: function() {
        this.control({
             'someSelector': {        // what does this selector need to be?
                  someEvent: //handle event
             },
             ...
        });
    }
});

What does 'someSelector' need to be to accomplish this?

4

1 回答 1

1

The selectors work in a very similar manner to CSS selectors:

myView *

Any child element at any depth under myView.

于 2013-08-27T23:46:24.143 回答