Ext.app.ViewController,将多个组件指向单个处理程序(Ext.app.ViewController, Point More than One Component to A Sing

编程入门 行业动态 更新时间:2024-10-27 19:25:33
Ext.app.ViewController,将多个组件指向单个处理程序(Ext.app.ViewController, Point More than One Component to A Single Handler)

在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': { }

更多推荐

本文发布于:2023-08-06 20:53:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1455325.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:多个   组件   程序   ViewController   app

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!