日期:2014-05-16 浏览次数:20737 次
<html><head>
<link href="css/ui.jqgrid.css" rel="stylesheet" type="text/css" />
<link href="css/jquery-ui-1.8.18.custom.css" rel="stylesheet" type="text/css" />
<script src="js/jquery.js" type="text/javascript"> </script>
<script src="js/jquery-ui-1.8.18.custom.min.js" type="text/javascript"> </script>
<script src="js/i18n/grid.locale-en.js" type="text/javascript"></script>
<script src="js/jquery.jqGrid.min.js" type="text/javascript"> </script>
</head>
<body>
<table id="grid">
</table>
<div id="pager">
</div>
<script type="text/javascript">
$(function(){
jQuery("#grid").jqGrid({
width:930,
dataType:'json',
url:'json.txt',
colNames:["id","no","name"],
colModel:
[
{name:"id",index:"id",align:'left'},
{name:"no",index:"no",align:'left'},
{name:"name",index:"name",align:'left'}
],
viewrecords:true,
rowNum:4,
rowList:[4,5,6],
jsonReader:{
root: "rows",
page: "12",
total: "total",
records: "records",
repeatitems: false
},
pager:"#pager"
});
});
</script>
</body>
</html>
{
"rows":[
{"id":"01","no":"001","name":"sky1"},
{"id":"02","no":"002","name":"sky23"},
{"id":"03","no":"003","name":"sky456"}
]
}
width:930,
//dataType:'json',//大小写没区分
datatype:'json',
url:'json.txt',