- 爱易网页
-
JavaSript
- Spring3.0+Struts2.2+Hibernate3.6+ExtJS3.2.0+DWR框架 调整五
日期:2014-05-16 浏览次数:20492 次
Spring3.0+Struts2.2+Hibernate3.6+ExtJS3.2.0+DWR框架 整合五
一、结合Extjs页面代码
<%@ 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>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<script type="text/javascript" src="js/superAdmin/usermanager.js"></script>
</head>
<body>
<div>
<div id="search_panel" style="margin:8px 8px 4px 8px" ></div>
<div id="main_panel" style="margin:4px 8px 10px 8px;padding-top:5px;"></div>
<div id="add_window"></div>
<div id="alter_window"></div>
</div>
</body>
</html>
usermanager.js文件
Ext.onReady(function(){
var flag = false;
Ext.QuickTips.init();
Ext.apply(Ext.form.VTypes,{//自定义密码验证
vPassword:function(val,field){
if(field.comfirmTo){
var pwd = Ext.get(field.comfirmTo);
return (val==pwd.getValue());
}
return false;
}
});
//查询面板
var search_form = new Ext.form.FormPanel({
title:'用户搜索',
labelSeparator :':',//分隔符
labelWidth : 80,//标签宽度
bodyStyle:'padding:2',//表单边距
frame : true,
collapsible: true,
height:70,
width:window.screen.width-220,
applyTo :'search_panel',
items:[
new Ext.form.TextField({
fieldLabel : '用户帐号',
id : 'user_code',
width:(window.screen.width-320)*0.18,
itemCls:'float-left',//向左浮动
clearCls:'allow-float',//允许浮动
selectOnFocus : true,//得到焦点时自动选择文本
allowBlank : true
}),
new Ext.form.TextField({
fieldLabel : '用户姓名',
id : 'name',
width:(window.screen.width-320)*0.18,
itemCls:'float-left',//向左浮动
clearCls:'allow-float',//允许浮动
selectOnFocus : true,//得到焦点时自动选择文本
allowBlank : true
}),
new Ext.form.ComboBox({
fieldLabel:"所属部门",
id:"_department",
hiddenName:'department',
editable:false,
itemCls:'float-left',//向左浮动
clearCls:'allow-float',//允许浮动
emptyText:"请选择所属部门",
width:(window.screen.width-320)*0.18,
store:new Ext.data.JsonStore({
url:'department_searchComboBox.action',
totalProperty:'totalCount',