📄 ext-window.js
字号:
var i=0;
function newWin() {
var form_employee = new Ext.FormPanel({
layout:'column',
items:[{
items:[{
columnWidth:.5,
layout:'form',
border:false,
items:[
{
xtype:'textfield',
fieldLabel:'合同编号',
width:190,
name:'contractno',
allowBlank:false
},
{
xtype:'textfield',
fieldLabel:'项目名称',
width:190,
name:'proname',
allowBlank:'项目名称不能为空!'
},
new Ext.form.ComboBox({
fieldLabel:'所属部门',
name:'dept',
emptyText:'请选择部门'
})]
}]
},{
items:[{
columnWidth:.5,
layout:'form',
border:false,
items:[
{
xtype:'textfield',
fieldLabel:'项目编号',
width:200,
name:'prono',
allowBlank:false,
blankText:'项目编号不能为空'
},
new Ext.form.DateField({
fieldLabel:'完成时间',
name:'finishtime',
width:200
})
]
}]
}]
});
var tabs = new Ext.TabPanel({
width:683,
height:253,
activeTab:0,
defaults:{autoScroll:true,frame:true},
items:[{title:'基本信息',layout:'column',cls:'x-plain',items:[form_employee]},
{title:'Another Tab',html:'Some other content'}]
});
var win=new Ext.Window({
title:"frame"+i++,
buttonAlign:'right',
closable:true,
width:400,
height:300,
border:false,
plain:true,
layout:'fit',
defaults:{bodyStyle:'padding:10px'},
minimizable:true,
buttons:[{
text:'Save',
handler:function(){
alert("提交");
//if(form_employee.isValid()){
//form_employee.submit({
//url:'',
//method:'post',
//reset : true,
//failure : function(form, action) {
///Ext.MessageBox.alert('友情提示', action.result.info);
//},
//success : function(form, action) {
//addInstanceDlg.hide();
//store.reload();
//}
//});
//}else{
//Ext.MessageBox.alert('错误', '字段填写不正确!');
//}
}
}],
items:[tabs]
});
win.show();
}
Ext.onReady(function(){
Ext.get("btn").on("click",newWin);
});
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -