http://www.iteye.com/problems/15242
myWindow = function(cfg){
Ext.apply(this,cfg); //属性拷贝,apply将会覆盖目标对象中的属性
Ext.onReady(this.init, this);
}
Ext.extend(myWindow, Ext.util.Observable,{
init: function(){
this.formPanel = new Ext.form.FormPanel({
width:280,
height:280,
labelWidth:50,
frame:true,
defaultType:'textfield',
items:[
{
fieldLabel:'name'
},
{fieldLabel:'age'}
],
buttons:[
{text:'add'}
]
});
this.showWindow = new Ext.Window({
width:300,
height:300,
title:'坏蛋吧',
items:[this.formPanel]
});
this.showWindow.show();
}
});
new myWindow();
myWindow = function(cfg){
Ext.apply(this,cfg); //属性拷贝,apply将会覆盖目标对象中的属性
Ext.onReady(this.init, this);
}
Ext.extend(myWindow, Ext.util.Observable,{
init: function(){
this.formPanel = new Ext.form.FormPanel({
width:280,
height:280,
labelWidth:50,
frame:true,
defaultType:'textfield',
items:[
{
fieldLabel:'name'
},
{fieldLabel:'age'}
],
buttons:[
{text:'add'}
]
});
this.showWindow = new Ext.Window({
width:300,
height:300,
title:'坏蛋吧',
items:[this.formPanel]
});
this.showWindow.show();
}
});
new myWindow();