Thomas
Thomas

Reputation: 6690

Ext.app.ViewController, Point More than One Component to A Single Handler

In Ext JS 5.*, there is a new controller type to fit into Sencha's modeling of MVC: Ext.app.ViewController. I am specifically interested in the linked control method, which according to the doc.s. utilizes Ext.ComponentQuery to "select" the components to which to listen.

A typical routing in this.control({}) looks like:

this.control({  
    'componentselector' : {  
        'event' : this.doSomething  
     }  
//....

Is it possible to route multiple components' 'event' to the same method on one line, e.g.:

this.control({  
    'componentselector', 'anothercomponentselector' : {  
        'event' : this.doSomething  
     }  
//....

Really, this question is more about syntactic sugar than anything else.

Upvotes: 1

Views: 31

Answers (1)

CD..
CD..

Reputation: 74146

Yes, like this:

'componentselector, anothercomponentselector': {

}

Upvotes: 4

Related Questions