0
http://trirand.com/blog/jqgrid/jqgrid.htmlのようにJQGridを使用しようとしています。しかし、それは何も表示されていません。この作業を手伝ってください。JQGridが表示されない
<html>
<head>
<script type="text/javascript" src="jquery-3.1.1.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
jQuery("#s3list").jqGrid({
url:'search.php?q=1',
datatype: "json",
width: 700, colNames:[
'Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
colModel:[
{name:'id',index:'id', width:65},
{name:'invdate',index:'invdate', width:90,
searchoptions:{
dataInit:function(el) {
$(el).datepicker({dateFormat:'yy-mm-dd'});
} }},
{name:'name',index:'name', width:100},
{name:'amount',index:'amount', width:80, align:"right"},
{name:'tax',index:'tax', width:80, align:"right", stype:'select',
editoptions:{value:":All;0.00:0.00;12:12.00;20:20.00;40:40.00;60:60.00;120:120.00"}},
{name:'total',index:'total', width:80,align:"right"}
{name:'note',index:'note', width:150, sortable:false}
],
rowNum:10,
mtype: "POST",
rowList:[10,20,30],
pager: '#s3pager',
sortname: 'id',
viewrecords: true,
rownumbers: true,
sortorder: "desc",
gridview : true,
caption:"Toolbar Search Example"
});
jQuery("#s3list").jqGrid('navGrid','#s3pager',
{edit:false,add:false,del:false,search:false,refresh:false});
jQuery("#s3list").jqGrid('navButtonAdd',"#s3pager", {
caption:"Toggle",
title:"Toggle Search Toolbar",
buttonicon :'ui-icon-pin-s',
onClickButton:function(){
mygrid[0].toggleToolbar()
}
});
jQuery("#s3list").jqGrid('navButtonAdd',"#s3pager", {
caption:"Clear",
title:"Clear Search",
buttonicon :'ui-icon-refresh',
onClickButton:function(){
mygrid[0].clearToolbar()
}
});
jQuery("#s3list").jqGrid('filterToolbar');
});
</script>
</head>
<body>
<table id="s3list"></table>
<div id="s3pager"></div>
<div id="filter" style="margin-left:30%;display:none">Search Invoices</div>
</body>
</html>
てみインポートjqgridライブラリを助けた
希望。あなたの例はここで働いています。 http://jsfiddle.net/vwb1c0mk/143/ – Zzap
人々が読めるようにコードを書式設定する必要があります。現在のコードには**構文エラー**があります: 'colModel'の' total'と 'note'カラムの間にカンマがありません。型付きエラーだったので、 'url'から返されたJSONデータを含めるべきです。 jqGridに関するすべての質問には、**使用する(使用できる)** fork **([free jqGrid](https://github.com/free-mobile) jqGrid/jqGrid)、コマーシャル[Guriddo jqGrid JS](http://guriddo.net/?page_id=103334)またはバージョン<= 4.7の古いjqGrid)。 – Oleg