76.培训记录信息 Extjs 页面
1.培训记录信息页面jsp
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>"> <title>培训记录</title> <script type="text/javascript">
var trainRecordPanel = new TrainRecordPanel();
var tabId = Ext.getCmp('mainTab').getActiveTab().id.split('_')[1];
juage(tabId,"trainr",trainRecordPanel,"trainRecord");
</script> </head>
<body>
<div id="trainRecord" ></div>
</body>
</html>
2.培训记录页面js
TrainRecordPanel = Ext.extend(Ext.Panel,{
id: 'trainRecordPanelId',
constructor: function(){
tRecordQueryPanel = new TRecordQueryPanel();
tRecordInfoGridPanel = new TRecordInfoGridPanel();
TrainRecordPanel.superclass.constructor.call(this,{
style: 'margin:0 auto',
border: false,
//layout: 'fit',
//autoWidth: true,
//autorHeight: true,
items: [tRecordQueryPanel, tRecordInfoGridPanel]
})
}
})
3.
Ext.namespace("hrmsys.trainRecord.info");
/**
* 培训记录信息表格
* @author sux 2011-02-19
* @memberOf {TypeName}
* @return {TypeName}
*/
TRecordInfoGridPanel = Ext.extend(Ext.grid.GridPanel,{
id: 'tRecordInfoGridId',
constructor: function(){
Ext.QuickTips.init();
var sm = new Ext.grid.CheckboxSelectionModel();
var number = new Ext.grid.RowNumberer();
var cm = new Ext.grid.ColumnModel([
number, sm,
{
header: '编号',
dataIndex: 'tRecordId',
align: 'center'
},{
header: '培训对象',
dataIndex: 'empName',
align: 'center'
},{
header: '培训人',
dataIndex: 'trainPerson',
align: 'center'
},{
header: '培训时间',
dataIndex: 'trainDate',
align: 'center'
},{
header: '培训主题',
dataIndex: 'trainTitle',
align: 'center'
},{
header: '培训地点',
dataIndex: 'trainPlace',
align: 'center'
},{
header: '结果',
dataIndex: 'trainResult',
align: 'center',
renderer: function(value){
if(value == 0){
return "未参加";
}else if( value == 1){
return "优秀";
}else if( value == 2){
return "良好";
}else if( value == 3){
return "及格";
}else if( value == 4){
return "不及格";
}
}
}]);
var trainStore = new Ext.data.JsonStore({
url: 'tRecord_list.action',
root: 'root',
totalProperty: 'totalProperty',
fields: ['tRecordId','empName','trainPerson','trainDate','trainTitle','trainPlace','trainResult']
});
TRecordInfoGridPanel.superclass.constructor.call(this, {
width: Ext.getCmp('mainTab').getActiveTab().getInnerWidth(),
height: Ext.getCmp('mainTab').getActiveTab().getInnerHeight(),
/**表格高度自适应 document.body.clientHeight浏览器页面高度 start**/
monitorResize: true,
doLayout: function() {
this.setWidth(document.body.clientWidth-205);
this.setHeight(document.body.clientHeight-250);
Ext.grid.GridPanel.prototype.doLayout.call(this);
} ,
viewConfig: {
forceFit: true,
autoFill: true,
columnsText : "显示/隐藏列",
sortAscText : "正序排列",
sortDescText : "倒序排列"
},
border: false,
height: 500,
frame: true,
cm: cm,
sm: sm,
store: trainStore,
tbar: new Ext.Toolbar({
items: [{
text: '显示全部',
iconCls: 'all',
handler: function(){
trainStore.load();
}
},{
text: '删除',
iconCls: 'delete',
id: 'trainr_delete',
handler: delTRecordFn
},{
text: '添加',
iconCls: 'add',
id: 'trainr_add',
handler: addTRecordFn
},{
text: '修改',
iconCls: 'update',
id: 'trainr_update',
handler: updateTRecordFn
},{
text: '详情',
iconCls: 'detail',
id: 'trainr_detail',
handler: detailTRecordFn
}]
}),
bbar: new PagingToolbar(trainStore,20)
});
trainStore.load({
params: {
start: 0,
limit: 20
}
});
}
});
delTRecordFn = function(){
gridDel('tRecordInfoGridId','tRecordId','tRecord_delete.action');
};
addTRecordFn = function(){
var trainRecordAddWin = new TrainRecordAddWin()
trainRecordAddWin.show();
} /**
* 培训记录查询面板
* @memberOf {TypeName}
* @author sux 2011-02-19
*/
var TRecordQueryPanel = Ext.extend(Ext.Panel,{
id: 'tRecordQueryId',
constructor: function(){
TRecordQueryPanel.superclass.constructor.call(this,{
collapsible: true,
titleCollapse: true, //单击整个collapse都有效
//collapsed: true, //渲染后即闭合
title: '条件查询',
border: false,
frame: true,
autoWidth: true,
defaultType: 'fieldset',
items: [{
title: '条件',
layout: 'table',
layoutConfig: {
columns: 7
},
defaults: {
labelWidth: 60,
labelAlign: 'right'
},
items: [{
layout: 'form',
items: [{
xtype: 'textfield',
fieldLabel: '培训对象',
id: 'empName',
width: 100
}]
},{
layout: 'form',
items: [{
xtype: 'textfield',
fieldLabel: '培训人',
width: 100,
id: 'trainPerson'
}]
},{
layout: 'form',
items: [{
xtype: 'textfield',
fieldLabel: '培训主题',
width: 100,
id: 'trainTitle'
}]
},{
layout: 'form',
items: [{
xtype: 'datefield',
fieldLabel: '开始时间',
format: 'Y-m-d',
width: 100,
id: 'startDate'
}]
},{
layout: 'form',
items: [{
xtype: 'datefield',
fieldLabel: '结束时间',
format: 'Y-m-d',
width: 100,
id: 'endDate'
}]
},{
style: 'margin: 0px 10px 0px 20px;',
xtype: 'button',
text: '查询',
iconCls: 'search',
handler: queryTRecordFn
},{
xtype: 'button',
text: '取消',
iconCls: 'cancel',
handler: cancelTRecordFn
}]
}]
})
}
});
queryTRecordFn = function(){
var empName = Ext.get("empName").dom.value;
var trainPerson = Ext.get("trainPerson").dom.value;
var trainTitle = Ext.get("trainTitle").dom.value;
var startDate = Ext.get("startDate").dom.value;
var endDate = Ext.get("endDate").dom.value;
Ext.getCmp('tRecordInfoGridId').getStore().load({
params: {
type: 'query',
empName: empName,
startDate: startDate,
endDate: endDate,
trainTitle: trainTitle,
trainPerson: trainPerson,
start: 0,
limit: 20
}
})
};
cancelTRecordFn = function(){
Ext.get("empName").dom.value = "";
Ext.get("trainPerson").dom.value = "";
Ext.get("trainTitle").dom.value = "";
Ext.get("startDate").dom.value = "";
Ext.get("endDate").dom.value = "";
};
updateTRecordFn = function(){
var trainRecordAddWin = new TrainRecordAddWin()
trainRecordAddWin.title = '培训记录修改';
var selectionModel = Ext.getCmp('tRecordInfoGridId').getSelectionModel();
var record = selectionModel.getSelections();
if(record.length != 1){
Ext.Msg.alert('提示','请选择一个');
return;
}
var tRecordId = record[0].get('tRecordId');
Ext.getCmp('tRecordAddPanelId').getForm().load({
url: 'tRecord_edit.action',
params: {
trainRecordId: tRecordId
}
})
trainRecordAddWin.show();
};
detailTRecordFn = function(){
var trainRecordDetailWin = new TrainRecordDetailWin()
var selectionModel = Ext.getCmp('tRecordInfoGridId').getSelectionModel();
var record = selectionModel.getSelections();
if(record.length != 1){
Ext.Msg.alert('提示','请选择一个');
return;
}
var tRecordId = record[0].get('tRecordId');
Ext.getCmp('tRecordDetailPanelId').getForm().load({
url: 'tRecord_edit.action',
params: {
trainRecordId: tRecordId
}
})
trainRecordDetailWin.show();
};
5.培训信息添加窗口
TrainRecordAddWin = Ext.extend(Ext.Window,{
id: 'tRecordAddWinId',
constructor: function(){
var trainRecordAddPanel = new TrainRecordAddPanel();
TrainRecordAddWin.superclass.constructor.call(this, {
width: 500,
height: 300,
resizable: false, //不能改变窗体大小
title: '培训记录信息录入',
collapsible: true,
modal: true,
items: [trainRecordAddPanel]
})
}
}) TrainRecordAddPanel = Ext.extend(Ext.form.FormPanel,{
id: 'tRecordAddPanelId',
constructor: function(){
Ext.QuickTips.init();
var reader = new Ext.data.JsonReader({},[{
name: 'trainRecord.trecordId', mapping: 'trecordId'
},{
name: 'title', mapping: 'train.trainTitle'
},{
name: 'trainRecord.train.trainId', mapping: 'train.trainId'
},{
name: 'trainRecord.employee.empId', mapping: 'employee.empId'
},{
name: 'trainRecord.trecordResult', mapping: 'trecordResult'
},{
name: 'trainRecord.trecordRemark', mapping: 'trecordRemark'
}]);
TrainRecordAddPanel.superclass.constructor.call(this,{
width: 520,
border: false,
height: 270,
frame: true,
reader: reader,
defaults: {
labelWidth: 60,
labelAlign: 'right'
},
items:[{
layout: 'form',
items: [{
xtype: 'hidden',
name: 'trainRecord.trecordId'
},{
xtype: 'textfield',
fieldLabel: '培训主题',
width: 150,
allowBlank: false,
msgTarget: 'side',
blankText: '不能为空',
name: 'title',
id: 'title',
listeners: {'focus': function(){
var trainGridWin = new TrainGridWin();
trainGridWin.show();
}
}
},{
xtype: 'textfield',
fieldLabel: '工号',
allowBlank: false,
msgTarget: 'side',
blankText: '不能为空',
width: 150,
name: 'trainRecord.employee.empId'
},{
xtype: 'combo',
fieldLabel: '培训结果',
width: 150,
allowBlank: false,
msgTarget: 'side',
blankText: '不能为空',
triggerAction: 'all',
editable: false,
mode: 'local',
store: new Ext.data.SimpleStore({
fields: ['name','value'],
data: [["未参加","0"],["优秀","1"],["良好","2"],["及格","3"],["不及格","4"]]
}),
displayField: 'name',
valueField: 'value',
hiddenName: 'trainRecord.trecordResult'
},{
layout: 'form',
items: [{
xtype: 'textarea',
fieldLabel: '备注',
width: 370,
height: 100,
name: 'trainRecord.trecordRemark'
},{
xtype: 'hidden',
name: 'trainRecord.train.trainId',
id: 'trainId'
}]
}]
}],
buttonAlign: 'center',
buttons: [{
columnWidth: .5,
text: '保存',
iconCls: 'save',
handler: this.saveTRecordFn
},{
columnWidth: .5,
text: '关闭',
iconCls: 'cancel',
handler: this.cancelTRecordFn
}]
})
},
saveTRecordFn : function(){
if(!Ext.getCmp('tRecordAddPanelId').getForm().isValid()){
return;
}
Ext.getCmp('tRecordAddPanelId').getForm().submit({
url: 'tRecord_save.action',
method: 'post',
waitTitle: '提示',
waitMsg: '正在保存数据...',
success: saveTRecordSuccessFn,
failure: saveTRecordFailureFn
})},
cancelTRecordFn : function(){
Ext.getCmp('tRecordAddWinId').destroy();
}
});
saveTRecordSuccessFn = function(form, action){
Ext.Msg.confirm('提示',action.result.msg, function(button, text){
if(button == "yes"){
form.reset();
Ext.getCmp('tRecordAddWinId').destroy();
Ext.getCmp('tRecordInfoGridId').getStore().reload();
}
})
};
saveTRecordFailureFn = function(form, action){
Ext.Msg.alert('提示','连接失败', function(button, text){});
};
76.培训记录信息 Extjs 页面的更多相关文章
- 75.培训管理-培训信息发布 Extjs 页面
1. <%@ page language="java" import="java.util.*" pageEncoding="UTF-8&quo ...
- 如何进行SCCM中客户端记录信息维护
SCCM 部署完毕之后,不久我们就会发现客户端代理状态,因为重装系统,非正常的退域,长时间不开机,导致客户端状态有不可用的,有过期的,重复的记录很多.当然我们可以手动的快速删除重复的记录,那么怎么能做 ...
- 网页调试技巧:抓取马上跳转的页面POST信息或者页面内容
http://www.qs5.org/Post/625.html 网页调试技巧:抓取马上跳转的页面POST信息或者页面内容 2016/02/02 | 心得分享 | 0 Replies 有时候调试网页或 ...
- 通过cookie记录,设置页面访问的跳转页
通过cookie记录,设置页面访问的跳转页 转载自:http://blog.csdn.net/yixiao_naihe/article/details/26679515. 目的: 1.访问fm.htm ...
- 26.Extjs 部门列表信息展示页面
/** * @author sux * @time 2011-1-14 * @desc 部门信息显示 */ deptInfoGridPanel = Ext.extend(Ext.grid.Editor ...
- 78.员工个人信息保镖页面 Extjs 页面
1 <%@ page language="java" import="java.util.*" pageEncoding="UTF-8" ...
- 83.个人信息维护页面 Extjs 页面
1 <%@ page language="java" import="java.util.*" pageEncoding="UTF-8" ...
- 69.资金管理-税率表管理extjs 页面
1. <%@ page language="java" import="java.util.*" pageEncoding="UTF-8&quo ...
- js记录用户访问页面和停留时间
1.setInterval setInterval() 方法可按照指定的周期(以毫秒计)来调用函数或计算表达式. setInterval(code,millisec[,"lang" ...
随机推荐
- vs for Mac中的启用Entity Framework Core .NET命令行工具
在vs for Mac的工具菜单中已没有了Package Manager Console. 我们可以通过以下方法使用Entity Framework Core .NET命令行工具: 1.添加Nuget ...
- Java 基础入门随笔(1) JavaSE版——java语言三种技术架构
1.java语言的三种技术架构: J2SE(java 2 Platform Standard Edition):标准版,是为开发普通桌面和商务应用程序提供的解决方案.该技术体系是其他两者的基础,可以完 ...
- CAD在网页中如何设置实体闪烁?
主要用到函数说明: MxDrawXCustomFunction::Mx_TwinkeEnt 闪烁实体.详细说明如下: 参数 说明 McDbObjectId id 被闪烁的实体对象id LONG lCo ...
- 数组的复制 --System.arraycopy()
import java.util.Arrays; public class HellowWorld { public static void main(String[] argv ) { int[] ...
- 数字化婚姻配对尝试问题(C++实现)
问题描述:一.标题: 数字化婚姻配对尝试 二.题目: 建立一个模型,来模拟推导社会男女择偶过程. 为了模型简化,一个人的特性指标有三个,这里假设为财富.样貌.品格,每个指标均可取值1-100之间任意数 ...
- 模板中tempname与class区别
前言 在分析traits编程之前, 我们需要对模板参数类型tempname和class有一定的了解, 要明白他们在哪些方面不同, 哪些方面相同, 这样才能对体会到traits编程的核心. 如果你已经明 ...
- 【Android】一个好用的sharedpreferences存储类方法
其实我也不知道sharedpreferences究竟安全不安全,毕竟是android中最简单的存储机制. 如果你手机root了的话,使用MT管理器到data/data/包名/shared_prefs下 ...
- 68.document增删改原理
主要知识点 document增的原理 document删的原理 document改的原理 一.document增的原理 一个document存入es大致要分以下几个步骤 (1)数据写入buffer, ...
- linux学习3-简单磁盘管理
简单的磁盘管理 下面涉及的命令具有一定的危险性,操作不当可能会丢失你的个人数据,初学者建议在虚拟环境中进行操作 通常情况下,这一小节应该直接将如何挂载卸载磁盘,如何格式化磁盘,如何分区,但如你所见,我 ...
- Spring Cloud 之 Cookie 丢失 与 Host 传递
通过spring zuul 代理至后台,写入Cookie发现无法写入,到浏览器中,和无法获取Domain域名 通过长时间的度娘和求助别人发现:Spring-zuul 需要加入以下配置 zuul.se ...