我创建的延伸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