82jqGrid - 搜索_html

JSON(格式化后)

82jqGrid - 搜索_json_02

HTML代码举例

<html>
<head>
<title>jqGrid 实例</title>
</head>
<body>
···代码省略···
<table id="pgrid4"></table>
<div id="ppager4"></div>
<a href="data.json">JSON FILE</a>
···代码省略···
</body>
</html>

javascript代码举例

$(function(){
pageInit();
});
function pageInit(){
jQuery("#pgrid4").jqGrid('jqPivot',
"data.json",
// pivot options
{
xDimension : [
{
dataName: 'CategoryName',
width:90
},{
dataName: 'ProductName'
}
],
yDimension : [
{
dataName: 'Country'
}
],
aggregates : [
{
member : 'Price',
aggregator : 'sum',
width:80,
formatter:'number',
align:'right',
summaryType: 'sum'
}
],
rowTotals: true,
colTotals: true
},
// grid options
{
width: 700,
rowNum : 10,
pager: "#ppager4",
caption: "Totals by columns and rows"
});
$("#grid").jqGrid('navGrid','#pager',{add:false, edit:false, del:false, search:true});

}