首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Web前端 >

jquery easyui dataGrid 跟struts2结合使用小例子

2012-10-10 
jquery easyui dataGrid 和struts2结合使用小例子很高兴又步入到jquery easyui的学习中,说实话我喜欢web开

jquery easyui dataGrid 和struts2结合使用小例子

很高兴又步入到jquery easyui的学习中,说实话我喜欢web开发......

java代码:

???<action name="easyAction" style="height: 157px;" width="770"><%
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>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">


热点排行