Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/extjs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在extjs4 Ext.MessageBox.alert()中,是否显示空白窗口?_Extjs_Extjs4 - Fatal编程技术网

在extjs4 Ext.MessageBox.alert()中,是否显示空白窗口?

在extjs4 Ext.MessageBox.alert()中,是否显示空白窗口?,extjs,extjs4,Extjs,Extjs4,我在extjs4中工作,我将在屏幕上打印一个消息框,但它显示一个空白的消息窗口,其中没有显示任何消息 这是我的密码:- Ext.application({ name: 'App', appFolder: 'app', //controllers: ['Books'], requires:[ 'Ext.window.MessageBox', // 'Ext.tip.*'

我在extjs4中工作,我将在屏幕上打印一个消息框,但它显示一个空白的消息窗口,其中没有显示任何消息

这是我的密码:-

Ext.application({
    name: 'App',

    appFolder: 'app',

    //controllers: ['Books'],
    requires:[
                 'Ext.window.MessageBox',
              //   'Ext.tip.*'
             ],
    launch: function() {
        Ext.create('Ext.tab.Panel', {
            renderTo: Ext.getBody(),
            height: 100,
            width: 200,
            items: [
                {
                    // Explicitly define the xtype of this Component configuration.
                    // This tells the Container (the tab panel in this case)
                    // to instantiate a Ext.panel.Panel when it deems necessary
                    xtype: 'panel',
                    title: 'Tab One',
                    html: 'The first tab',
                    listeners: {
                        render: function() {
                           //Ext.MessageBox.alert('Rendered One', 'Tab One was rendered.');
                             Ext.Msg.alert('hi', 'Please enter your name:');
                            //Ext.MessageBox.confirm('Confirm', 'Are you sure you want to do that?');
                            //alert("hi");

                        }
                    }
                },
                {
                    // this component configuration does not have an xtype since 'panel' is the default
                    // xtype for all Component configurations in a Container
                    title: 'Tab Two',
                    html: 'The second tab',
                    listeners: {
                        render: function() {
                            //Ext.MessageBox.alert('Rendered One', 'Tab Two was rendered.');
                        }
                    }
                }
            ]
        });
    }
});
这是信息屏幕窗口

没有任何messageBox方法可以工作此代码中有什么错误? 请给我一些建议…

使用“boxready”事件()

如果输出到控制台:

...
render: function() {
    console.log(Ext.Msg.alert('hi', 'Alert message'))
}
....
在“渲染”侦听器中,您将看到错误地计算了警报的大小和位置:

...
width: NaN
x: -41
...
使用“boxready”事件()

如果输出到控制台:

...
render: function() {
    console.log(Ext.Msg.alert('hi', 'Alert message'))
}
....
在“渲染”侦听器中,您将看到错误地计算了警报的大小和位置:

...
width: NaN
x: -41
...

这些链接可能会有帮助:我不知道为什么在penel呈现时显示消息。。如果您将它放在
启动:function()
的底部,那么它能工作吗?
Ext.MessageBox.confirm
和normal
alert()
是否按预期工作?我指的是以下链接中的代码这些链接可能会有帮助:我不确定为什么在呈现penel时显示消息。。如果您将它放在
启动:function()
的底部,那么它能工作吗?
Ext.MessageBox.confirm
和normal
alert()
是否按预期工作?我指的是以下链接中的代码