ExtJS4 MessageBox引发错误

时间:2014-01-02 17:35:17

标签: extjs4 runtime-error

使用以下功能:

function showError(ptitle,perror){
    Ext.Msg.show({
        title: ptitle,
        icon: Ext.MessageBox.ERROR,
        msg: perror,
        buttons: Ext.MessageBox.OK
    });
}

我收到以下错误:

Uncaught TypeError: Cannot read property 'ERROR' of undefined 

我看不到小麦这个代码有问题。任何帮助,将不胜感激。

2 个答案:

答案 0 :(得分:0)

相同的代码在我的位置工作, 只需尝试使用Ext.Msg.ERROR而不是Ext.MessageBox.ERROR。

答案 1 :(得分:0)

这应该有效:

Ext.MessageBox.show({
    title: ptitle,
    icon: Ext.MessageBox.ERROR,
    msg: perror,
    buttons: Ext.MessageBox.OK
});