在Ext JS 5. *中,有一种新的控制器类型适合Sencha的MVC建模: Ext.app.ViewController 。 我对链接control方法特别感兴趣,根据doc.s. 利用Ext.ComponentQuery “选择”要监听的组件。
this.control({})典型路由如下所示:
this.control({ 'componentselector' : { 'event' : this.doSomething } //....是否可以在一行中将多个组件的“事件”路由到同一方法,例如:
this.control({ 'componentselector', 'anothercomponentselector' : { 'event' : this.doSomething } //....真的,这个问题更多的是语法糖而不是其他任何东西。
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.
最满意答案
是的,像这样:
'componentselector, anothercomponentselector': { }Yes, like this:
'componentselector, anothercomponentselector': { }更多推荐
发布评论