javascript - 在 extjs 4 中扩展消息框

标签 javascript extjs4 messagebox extjs-mvc

我创建了一个扩展 ext.window.messagebox 的新 View 类 但是当我尝试显示它时,它给了我一个错误:

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

这可能是什么原因造成的?

最佳答案

问题是您拼错了“closeable”——您把它写成了“closable”。

编辑:抱歉 - 这是不正确的。我已经删除了示例。

关于javascript - 在 extjs 4 中扩展消息框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16474617/

相关文章:

extjs - 如何一次过滤具有多个值的商店?

extjs - 分机 JS 4 : grid - some action on itemclick and different action when clicked on action column

C# - MessageBox - 资源和换行符中的消息本地化

java - 带有“确定”按钮的消息框错误 - 字符串被截断

javascript - 动态添加@font-face到svg

javascript - Github 中的代码与生产服务器上的代码不一样

Extjs 回调函数到 Controller

javascript - 无法将 javascript 添加到 chrome 扩展 html

javascript - Jquery 列表更新

python - 如何在python 3中更改或禁用tkinter消息框的默认声音