我創建的延伸ext.window.messagebox 一個新的視圖類,但是當我試圖表明它,它給了我一個錯誤:在ExtJS的擴展信息框4
Uncaught TypeError: Cannot call method 'setVisible' of null
我的代碼:
Ext.define('view.forms.MyBox', {
extend : 'Ext.window.MessageBox',
alias : 'widget.info',
xtype : 'forms-info',
resizable : false,
//closable : false --> removed
layout : 'vbox',
padding : 5,
width : 400,
height : 160,
showMessage: function() {
console.log('show message')
var me = this;
me.show({
title: 'Title foo!',
msg: 'test',
closable : false, // added here
icon: Ext.MessageBox.WARNING,
});
}
}); //eoc myBox
這可能的原因是什麼?
我想你需要添加這個:'this.callParent(arguments)' – 2013-05-10 03:39:31
請附上完整的代碼 – Hariharan 2013-05-10 04:13:17
好吧,我設法通過刪除可關閉:false配置並將其添加到me.show()函數來解決此問題。但我仍然不明白爲什麼?我更新了我的代碼... – xiriusly 2013-05-10 05:58:58