在extjs4 Ext.MessageBox.alert()中,是否显示空白窗口?
我在extjs4中工作,我将在屏幕上打印一个消息框,但它显示一个空白的消息窗口,其中没有显示任何消息 这是我的密码:-在extjs4 Ext.MessageBox.alert()中,是否显示空白窗口?,extjs,extjs4,Extjs,Extjs4,我在extjs4中工作,我将在屏幕上打印一个消息框,但它显示一个空白的消息窗口,其中没有显示任何消息 这是我的密码:- Ext.application({ name: 'App', appFolder: 'app', //controllers: ['Books'], requires:[ 'Ext.window.MessageBox', // 'Ext.tip.*'
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
和normalalert()
是否按预期工作?我指的是以下链接中的代码这些链接可能会有帮助:我不确定为什么在呈现penel时显示消息。。如果您将它放在启动:function()
的底部,那么它能工作吗?Ext.MessageBox.confirm
和normalalert()
是否按预期工作?我指的是以下链接中的代码