【发布时间】:2020-02-29 12:00:14
【问题描述】:
我在 Ext.Msg 上定义了一些监听器,但它们从未被解雇。有什么我想念的吗?
Ext.Msg.show({
title:'Save Changes?',
message: 'You are closing a tab that has unsaved changes. Would you like to save your changes?',
buttons: Ext.Msg.YESNO,
icon: Ext.Msg.QUESTION,
defaultListenerScope: true,
fn: function(btn) {
if (btn === 'yes') {
console.log('Yes pressed');
} else if (btn === 'no') {
console.log('No pressed');
} else {
console.log('Cancel pressed');
}
},
listeners: {
activate: function(mb){
console.log('Height: '+mb.getHeight()+' Width: '+mb.getWidth());
},
afterrender: function(mb){
console.log('Height: '+mb.getHeight()+' Width: '+mb.getWidth());
}
}
});
【问题讨论】: