Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/extjs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Extjs 如何在控制器中为控件正确添加侦听器?_Extjs_Sencha Touch - Fatal编程技术网

Extjs 如何在控制器中为控件正确添加侦听器?

Extjs 如何在控制器中为控件正确添加侦听器?,extjs,sencha-touch,Extjs,Sencha Touch,我可以成功地将侦听器添加到selectfield视图中的painted事件中。但是,如何在控制器中执行此操作 control: { "#form #field": { painted: 'onPainted' } } // omitted onPainted method that logs message in console 这不管用。但是,直接在视图中添加侦听器是可行的 // in the view for the selectfield (works)

我可以成功地将侦听器添加到
selectfield
视图中的
painted
事件中。但是,如何在控制器中执行此操作

control: {
    "#form #field": {
        painted: 'onPainted'
    }
}
// omitted onPainted method that logs message in console
这不管用。但是,直接在视图中添加侦听器是可行的

// in the view for the selectfield (works)
listeners: {
    painted: function() {
        console.log("Painted");
    }
}
我遗漏了什么?

来自以下网站的评论:

“出于性能原因”,此事件不会向控制器冒泡


啊,所以这只是一个特别的事件。谢谢你的推荐。事实上,我一直在看文档,但懒得看评论。