/**
* 证照编辑
*
* @class CertificationForm
* @extends Ext.Window
*/
StudentForm = Ext.extend(Ext.Window, {
formPanel : null,
constructor : function(a) {
Ext.applyIf(this, a);
this.initUI();
StudentForm.superclass.constructor.call(this, {
layout : "fit",
id : "StudentFormWin",
title : "学生档案",
iconCls : "menu-admin-certification-ledger",
width : 830,
height : 410,
border : false,
modal : true,
plain : true,
buttonAlign : "center",
buttons : [{
text : "确定",
iconCls : "btn-save",
scope : this,
handler : this.save
},{
text : "取消",
iconCls : "btn-cancel",
scope : this,
handler : function() {
this.close();
}
}],
items : {
xtype : "form",
layout : "column",
padding : 5,
anchor : "100%",
items : [{//1列--表单
columnWidth : .7,
layout : "form",
items : [{//1列行布局
layout : "column",
items : [{//1列1行1列布局
columnWidth : .5,
layout : "form",
items : [{
xtype:"textfield",
fieldLabel : "姓名",
anchor : "96%",
emptyText : "小明",
id:"name"
}]
},{//1列1行2列布局
columnWidth : .5,
layout : "form",
items : [{
xtype:"textfield",
fieldLabel : "班级",
anchor : "96%",
emptyText : "英语A",
id:"bj"
}]
}]
},{//1列行布局
layout : "column",
items : [{//1列1行1列布局
columnWidth : .5,
layout : "form",
items : [{
xtype:"textfield",
fieldLabel : "年龄",
anchor : "96%",
emptyText : "18",
id:"age"
}]
},{//1列1行2列布局
columnWidth : .5,
layout : "form",
items : [{
xtype:"textfield",
fieldLabel : "住址",
anchor : "96%",
emptyText : "长沙",
id:"dz"
}]
}]
},{//1列行布局
layout : "column",
items : [{//1列1行1列布局
columnWidth : .5,
layout : "form",
items : [{
xtype:"textfield",
fieldLabel : "性别",
anchor : "96%",
emptyText : "男",
id:"sex"
}]
},{//1列1行2列布局
columnWidth : .5,
layout : "form",
items : [{
xtype:"textfield",
fieldLabel : "民族",
anchor : "96%",
emptyText : "汉",
id:"mz"
}]
}]
}]
},{//2列--相片
columnWidth : .3,
layout : "form",
items : [{
anchor : "96%",
html:'<div><img src="image/mimi.jpg" /></div>'
}]
}]
},
keys : {
key : Ext.EventObject.ENTER,
fn : this.save,
scope : this
}
});
},
initUI : function() {
this.certificationId && this.loadData({
url : "/admin/getCertification.do?certificationId=" + this.certificationId,
dataName : "certification"
});
},
// // 保存
save : function() {
this.validate()
&& $submitObject(this.toObject(this.certification), "certification",
"/admin/saveCertification.do", function(resp) {
$callback(this, this.certification);
}, this);
}
});