And*_*ron 3 model-view-controller controller extjs4
我有一个网格和控制器.我尝试为网格监听'select'事件.
代码是:
Ext.define('Icc.controller.Questionnaires', {
extend: 'Ext.app.Controller',
stores: ['Questionnaires'],
models: ['Questionnaire'],
views: ['QuestionnairesGrid'],
init: function() {
this.control({
'mygrid > selectionmodel': {
// do what I need here
}
});
}
});
Run Code Online (Sandbox Code Playgroud)
如何才能正确完成?
我找到了这样做的方法:
init: function() {
this.control({
'questionnairesgrid': {
selectionchange: this.selectionChange
}
});
},
Run Code Online (Sandbox Code Playgroud)
奇怪的是,我可以为网格本身的选择模型监听事件......