我在firefox上调试 EXT JS4.0的程序的时候其他的组建如BUTTON ,textfield都能正常显示。。。但是WINDOW就不能。。。查看firefox的控制台。。发现报错一个 this.container is null 的信息。。。。我查找了半天也没找到原因。。请大瞎指点。
代码如下
Ext.onReady(function(){
var button = new Ext.button.Button({
text:"one",
width:100,
renderTo:Ext.getBody(),
listeners:{
"click":function(){
alert(this.getText());
}
}
});
var _window = new Ext.Window({
layout: {
type: 'vbox',
align: 'left'
},
width:200,
height:100,
resizable:false,
frame:true,
border:4,
plain:true,
title:"测试",
items:[
{xtype:"textfield",fieldLabel:"姓名"},
{xtype:"textfield",fieldLabel:"明码"}
],
buttons:[
{
text:"打开",
listeners:{
"click":function(){
alert("打开了");
_window.show();
}
}
},
{
text:"关闭",
listeners:{
"click":function(){
alert("关闭了");
_window.hide();
}
}
}
]
});
_window.render(Ext.getBody());
_window.show();//4.0的SHOW方法有三个参数,但是都是可选的,因此我没有穿进去
});