ext window嵌套form,关闭window后第2次打开没有form
functionaddCar(){varwin=newExt.Window({title:'线路详细信息',id:'win',width:600,height:400,m...
function addCar(){
var win=new Ext.Window({
title:'线路详细信息',
id:'win',
width:600,
height:400,
modal : true,
maximizable:true,
items:form
});
win.show();
}
function addCar1(){
var win1=new Ext.Window({
title:"添加线路信息",
width:400,
height:300,
modal : true,
maximizable:true
});
win1.show();
}
var form=new Ext.FormPanel({
frame:true,
width:500,
//monitorValid:true,//把有formBind:true的按钮和验证绑定
layout:"form",
labelWidth:55,
title:"添加个人信息",
labelAlign:"right",
renderTo:Ext.getCmp("win"),//呈现页面win
items:[{
xtype:"textfield",
fieldLabel:"用户名",
emptyText:"不能为空,请正确填写",
name:"nama",
height:50,
anchor:"95%"
},{//上面是第一行
xtype:"panel",
layout:"column",
fieldLabel:"出生日期",
isFormField:true,
items:[{
columnWidth:.5,
xtype:"datefield",
name:"BirthDate",
anchor:"90%"
},{
columnWidth:.5, layout:"form", labelWidth:40,//注意,这个参数在这里可以调整简单fieldLabel的布局位置
items:[{
xtype:"combo",
name:"Degree",
fieldLabel:"学位",
store:["小学","初中","高中","专科","本科","硕士","博士"],
emptyText:"请选择适合你的学历",
anchor:"90%"
}]
}]
}],
buttons:[{text:"确定"},{text:"取消"}]
});
当把 form的所有内容直接放到window中 这样就能达到目的.但是既然form代码太多。请问谁有更好的办法吗?
在window属性里面加个closeAction:'hide' 好像不行啊... 展开
var win=new Ext.Window({
title:'线路详细信息',
id:'win',
width:600,
height:400,
modal : true,
maximizable:true,
items:form
});
win.show();
}
function addCar1(){
var win1=new Ext.Window({
title:"添加线路信息",
width:400,
height:300,
modal : true,
maximizable:true
});
win1.show();
}
var form=new Ext.FormPanel({
frame:true,
width:500,
//monitorValid:true,//把有formBind:true的按钮和验证绑定
layout:"form",
labelWidth:55,
title:"添加个人信息",
labelAlign:"right",
renderTo:Ext.getCmp("win"),//呈现页面win
items:[{
xtype:"textfield",
fieldLabel:"用户名",
emptyText:"不能为空,请正确填写",
name:"nama",
height:50,
anchor:"95%"
},{//上面是第一行
xtype:"panel",
layout:"column",
fieldLabel:"出生日期",
isFormField:true,
items:[{
columnWidth:.5,
xtype:"datefield",
name:"BirthDate",
anchor:"90%"
},{
columnWidth:.5, layout:"form", labelWidth:40,//注意,这个参数在这里可以调整简单fieldLabel的布局位置
items:[{
xtype:"combo",
name:"Degree",
fieldLabel:"学位",
store:["小学","初中","高中","专科","本科","硕士","博士"],
emptyText:"请选择适合你的学历",
anchor:"90%"
}]
}]
}],
buttons:[{text:"确定"},{text:"取消"}]
});
当把 form的所有内容直接放到window中 这样就能达到目的.但是既然form代码太多。请问谁有更好的办法吗?
在window属性里面加个closeAction:'hide' 好像不行啊... 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询