我已经设置 jqGrid 来显示我的数据,即使数据来自服务器,数据也不会显示在网格中。这是服务器响应。
这是JavaScript。
<table id="Grid1" class="scroll"></table>
<div id="pager" class="scroll" style="text-align:center;">
<script>
$(document).ready(function () {
jQuery("#Grid1").jqGrid({
url: 'api/matchingservicewebapi/getuser',
datatype: 'json',
mtype: 'GET',
colNames: ['Id', 'Account', 'Ref', 'BDate'],
colModel: [
{ name: 'Id', index: 'Id', width: 200 },
{ name: 'Account', index: 'Account', width: 300 },
{ name: 'Ref', index: 'Ref', width: 300 },
{ name: 'BDate', index: 'BDate', width: 300 }
],
rowNum: 10,
rowList: [10, 20, 30],
pager: '#pager',
sortname: 'Id',
viewrecoreds: true,
sortorder: "desc",
imgpath: 'Themes/images'
}).navGrid(pager, { edit: true, add: true, del: true, refresh: true, search: true });
});
下面是数据的JSON格式
{"Data":{"rows":[{"id":200.0,"cell":["100","AMX.Data.Account","200","1/10/2010 12:00:00 AM"]},{"id":14726632.0,"cell":["600146","AMX.Data.Account","14726632","1/8/2010 12:00:00 AM"]},{"id":6633000.0,"cell":["668152","AMX.Data.Account","6633000","1/8/2010 12:00:00 AM"]},{"id":2053178.0,"cell":["600146","AMX.Data.Account","2053178","1/8/2010 12:00:00 AM"]},{"id":753550.0,"cell":["668152","AMX.Data.Account","753550","1/8/2010 12:00:00 AM"]},{"id":121774.0,"cell":["600146","AMX.Data.Account","121774","1/8/2010 12:00:00 AM"]},{"id":37900.0,"cell":["600146","AMX.Data.Account","37900","1/8/2010 12:00:00 AM"]},{"id":6569.0,"cell":["668152","AMX.Data.Account","6569","1/8/2010 12:00:00 AM"]},{"id":-1124870617.0,"cell":["668152","AMX.Data.Account","-1124870617","1/8/2010 12:00:00 AM"]},{"id":-813658270.0,"cell":["668152","AMX.Data.Account","-813658270","1/8/2010 12:00:00 AM"]}]},"JsonRequestBehavior":0}
但是数据没有被加载。我究竟做错了什么?