窗口
var win = new Ext.Window({
title: "插入数据",
width: 990,
height: 600,
minimizable: true, // 最大化
maximizable: true, // 最小化
frame: true,
constrain: true, // 防止窗口超出浏览器窗口,保证不会越过浏览器边界
buttonAlign: "center", // 按钮显示的位置
plain: true, // 将窗口变为半透明状态。,
items: from,//from表
buttons: [
{
xtype: "button",
text: "确定",
handler: function () {
console.warn("确定")
}
},
{
xtype: "button",
text: "取消",
handler: function () {
console.warn("取消");
win.close();//关闭win窗口
}
}
]
});
win.show();
from表
var from= new Ext.form.FormPanel({
frame: true,
style: 'margin:6px',
items: [
{
xtype : "textfield",
fieldLabel : '姓名',
name : "NAME",
width : 200
}, {
xtype : "textfield",
fieldLabel : "年龄",
allowBlank : false, // 是否允许为空, 默认为 true
blankText : "用户名不能为空", // 显示错误提示信息
name : "user.username", // name 属性应与 Struts2 Action 中的属性保持一致
id : "AGE",
width : 200
}, {
xtype : "textfield",
fieldLabel : '性别',
name : "SEX",
width : 200
}, {
xtype : "textfield",
fieldLabel : '住址',
name : "ADRESS",
width : 200
}, {
xtype : "textfield",
fieldLabel : '年级',
name : "GRADE",
width : 200
}
]
});