【发布时间】:2013-05-10 03:15:56
【问题描述】:
我创建了一个扩展 ext.window.messagebox 的新视图类 但是当我尝试显示它时,它给了我一个错误:
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) -
请附上完整代码
-
好的,我设法通过删除 closable:false 配置并将其添加到 me.show() 函数来解决这个问题......但我仍然不明白为什么?我更新了我的代码...
标签: javascript extjs4 messagebox extjs-mvc