表格控件mmGrid 精简版 直接就可以用

<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath() + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<script type="text/javascript"
	src="<%=path%>sys/components/easyui/jquery.min.js"></script>
<link rel="stylesheet" type="text/css"
	href="<%=path%>sys/css/mmGrid.css">
<script type="text/javascript" src="<%=path%>sys/js/mmGrid.js"></script>
<link rel="stylesheet" type="text/css"
	href="<%=path%>sys/css/mmPaginator.css">
<script type="text/javascript" src="<%=path%>sys/js/mmPaginator.js"></script>
<script type="text/javascript">
	$(document).ready(
			function() {

				var fixed2 = function(val) {
					if (!val) {
						return '';
					}
					return val.toFixed(2);
				}
				var cols = [
						
						{
							title : '分组一',
							align : 'center',
							cols : [ {
								title : '字段一',
								name : 'ziduan1',
								width : 100,
								align : 'center',
								sortable : true,
								lockDisplay : true
							}, {
								title : '字段二',
								name : 'ziduan2',
								width : 100,
								align : 'center',
								sortable : true,
								lockDisplay : true
							} ]
						}
						];

				$('#mmg').mmGrid({
					height : 460,
					cols : cols,
					url : '/uploads/rs/412/rrczw3xl/stockQuotePage.json', //axaj  获取 数据
					sortName : 'SECUCODE',
					sortStatus : 'asc',
					multiSelect : true, //多选
					checkCol : true, //选框列
					fullWidthRows : true, //伸展列宽自动充满表格
					nowrap : true, //内容不折行
					plugins : [ $('#pg').mmPaginator({}) ]//分页插件
				});

			});
</script>
<style type="text/css">
body {
	font-family: 'Helvetica Neue', helvetica, "Hiragino Sans GB",
		"Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif;
	color: #333;
}

.mmGrid, .mmPaginator {
	font-size: 12px;
}

.btnPrice {
	display: block;
	width: 16px;
	height: 16px;
	margin: 0px auto;
	background:
		url(http://sandbox.runjs.cn/uploads/rs/412/rrczw3xl/botton_g1.gif)
		no-repeat;
}

.btnPrice:hover {
	background:
		url(http://sandbox.runjs.cn/uploads/rs/412/rrczw3xl/botton_g2.gif)
		no-repeat;
}
</style>
<body>
	<table id="mmg"></table>
	<div id="pg" style="text-align: right;"></div>
</body>

</html>

猜你喜欢

转载自blog.csdn.net/a1ccwt/article/details/52995795