我想问在哪里可以为我的网格MVC添加监听器。
当我这样做时,什么也不会发生:
Ext.define( myApp.view.reslist ,{
extend: Ext.grid.Panel ,
alias : widget.reslist ,
store : resStore ,
listeners: {
activate: {
fn: function(e){
console.log( reslist panel activated );
}
}
},
dockedItems: [{
xtype: pagbar ,
store: resStore ,
dock: top ,
displayInfo: true
}],
..... rest of grid configs
并且它与点击事件一起工作:
listeners: {
activate: {
fn: function(e){
console.log( reslist panel clicked );
}
}
}
注意:我的控制器的init仍然是空的:
Ext.define( myApp.controller.resControl , {
extend: Ext.app.Controller ,
stores: [ resStore ],
models: [ resModel ],
views: [ reslist , pagbar ],
init: function() {
// nothing here
}
});