日期:2014-05-16 浏览次数:20706 次
<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
<link rel="stylesheet" href="css/jquery-ui-1.7.2.custom.css" type="text/css"></link>
<link rel="stylesheet" href="css/ui.jqgrid.css" type="text/css"></link>
<script type="text/javascript" src="js/grid.locale-en.js"></script>
<script type="text/javascript" src="js/jquery.jqGrid.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("#list4").jqGrid({
url: "servlet/jsondb",
datatype : "json",
editurl:"servlet/testServlet",
mtype: 'POST',
height : 300,
colNames : [ '编号','姓名','日期', '地点', '经度', '纬度', '描述', '备注'],
autowidth : false,//自动设置宽度
rownumbers:true,
closeAfterSearch:true,
colModel : [{name: "id",index : "id", sorttype : "int",width : 60, editable :false, search : true},
{name: "xm",index : "xm",sorttype : "text", width : 100, editable :true, search : true},
{name: "rq",index : "rq", sorttype : "text", width : 100, editable :true, search : true},
{name: "dd",index : "dd",sorttype : "text",width : 150,editable :true,search : true} ,
{name : "jd",index : "jd",sorttype : "float",width : 80,editable :true,search : true},
{name : "wd",index : "wd",sorttype : "float",width : 80, editable :true,search : true},
{name : "ms",index : "ms",sorttype : "text",width : 150,editable :true,search : true},
{ name : "bz", index : "bz", sorttype : "text", width : 150,editable :true,search : true}
],
sortname : 'ID',
sortorder : "asc",
viewrecords: true,
rowNum : 10,
rowList : [ 10, 20, 30],
pager: '#pager',
caption : "列表",
jsonReader: {
repeatitems : false
},
gridview: true
});
jQuery("#list4").jqGrid('navGrid','#pager',{add: true, edit: true, del: true,search:true,refresh:true });
} );
</script>
</head>
<body style="background-image:url(./resource/background/background.png)">
<jsp:include page="head.jsp"></jsp:include>
<table id="list4" class="scroll" cellpadding="0" cel