代码如下:
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%
String contextPath = request.getContextPath();
%>
<html>
<head>
<jsp:include page="../head/heah.jsp" />
<title>用户管理</title>
<script type="text/javascript"
src="<%=contextPath%>/form/grid/views/js/yhgl.js"></script>

<script type="text/javascript">
/**
*用户信息
**/
var grid_demo_id = "myGrid1" ;
var dsOption= {
fields :[
{name : "ID"  },
{name : "YHM",type:"string" },
{name : "DLM" ,type:"string"},
{name : "MM" ,type: "string"}
],
uniqueField : "no"
};var colsOption = [
{id: "ID" , header: "ID" , width :1 },
{id: "YHM" , header: "用户名" , width :300 ,editor: { type :"text",validRule : ["required"]} },
{id: "DLM" , header: "登录名" , width :300,editor: { type :"text",validRule : ["required"]}},
{id: "MM" , header: "密码" , width :300, editor: { type :"text",validRule : ["required"]} }
 ];var gridOption={
id : grid_demo_id,
/* loadURL 支持函数, 该函数返回值是response对象 */
loadURL :"/XHCRM/XHCRMServlet?doMethod=getList&falg=yhgl",
saveURL :"/XHCRM/XHCRMServlet?doMethod=doSave&falg=yhgl",
width: "100%",  
height: "350", 
container : "mygrid_container",
toolbarPosition : "bottom", 
toolbarContent : "nav | pagesize | reload | add del save | print | state",
recountAfterSave : true ,
pageSize : 10 ,
pageSizeList : [10,20,30,50,100,200],
dataset : dsOption ,
columns : colsOption ,

onComplete : function(){  /*  列表创建后,并且数据载入完成 时触发的函数  */  },
defaultRecord : {
ID : 0,
YHM : "(请输入用户名)",
DLM : "(请输入登录名)",
MM : "(请输入密码)"
},
parameters : { a:123,b:222, c :[8,9] }
};//创建面板
var mygrid=new GT.Grid( gridOption );
GT.Utils.onLoad( function(){
mygrid.render();
} );//点击查询按钮 时 进行触发
function query() {
//拼接参数
var param={
yhm : GT.U.getValue(GT.$("yhm")),
dlm : GT.U.getValue(GT.$("dlm")),
yhmName : GT.U.getValue(GT.$("yhmName"))
}
// 由于模糊查询 所以在这里拼接 % .
param.yhm= "%"+param.yhm+"%";
param.dlm="%"+param.dlm+"%";
GT.$grid(mygrid).query( param );
}

</script>

</head>
<body style="padding: 0px; margin: 10px; background-color: #f3f3f3;">
<div class="gt-panel"
style="width: 100%; margin: 5px; margin-bottom: 15px; background-color: #ecf6ff">
<div class="gt-panel-head">
<span>用户资料</span>
</div>
<div class="gt-panel-body">
<input type="hidden" id="yhmName"
value="<%=request.getSession().getAttribute("yhmName")%>">
<table>
<tr> <td width="20%" align="right">
用户名称 </td>
<td width="30%">
<input type="text" id="yhm" value="" />
</td>
<td width="20%" align="right">
登录名
</td>
<td width="30%">
<input type="text" id="dlm" value="" />
</td> </tr>
</table>
</div>
<div class="gt-button-area">
<input type="button" class="gt-input-button" value="查询"
onclick="query()" />
<input type="reset" class="gt-input-button" />
</div>
</div>
<div id="mygrid_container" style="margin: 5px; margin-bottom: 15px;"></div>
</body>
</html>