jquery easyui dataGrid 和struts2结合使用小例子
很高兴又步入到jquery easyui的学习中,说实话我喜欢web开发......
java代码:
???<action name="easyAction" style="height: 157px;" width="770"><%<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
? <head>
??? <base href="<%=basePath%>">
???
??? <title>easyDemo.jsp</title>
?<link rel="stylesheet" type="text/css" href="jquery-easyui/themes/default/easyui.css">
?<link rel="stylesheet" type="text/css" href="jquery-easyui/themes/icon.css">
?<script type="text/javascript" src="jquery-easyui/jquery-1.4.2.min.js"></script>
?<script type="text/javascript" src="jquery-easyui/jquery.easyui.min.js"></script>
?
??? <script type="text/javascript" src="jslib/easyDemo.js"></script>
?<script type="text/javascript">
??$(function(){
???$('#tt').datagrid({
????title:'datagrid小例子',
????iconCls:'icon-ok',
????width:500,
????height:320,
????nowrap:false,
????striped: true,
????collapsible:true,
????url:'easyAction.action',
????loadMsg:'数据装载中......',
????sortName:'code',
????sortOrder:'desc',
????remoteSort:false,
????frozenColumns:[[
?????{field:'ck',checkbox:true}
????]],
????columns:[[
?????{title:'学号',field:'id',width:'140',rowspan:2,align:'center'},
?????{title:'姓名',field:'name',width:'150',rowspan:2,align:'center'},
?????{title:'班级',field:'className',width:'150',rowspan:2,align:'center'}
????]],
????pagination:true,
????rownumbers:true
????
???});
???$('#tt').datagrid('getPager').pagination({displayMsg:'当前显示从{from}到{to}共{total}记录'});
??});
??
?</script>
? </head>
?
? <body>
??? <a href="javascript:void(0)" onclick="verify()" style="height: 157px;" width="770">