当我没有返回任何行时,我们的 jqGrid 寻呼机会显示Page 1 of NaN
.
返回的 JSON 是:
{"page":"1","records":"0","total":"1"}
为什么NaN
上市?
更新:我们似乎只有在使用loadonce:true
.
这是源代码:
$("#list").jqGrid({
url:'NoData.json',
datatype: 'json',
mtype: 'GET',
colNames:['Product', 'Type'],
colModel :[
{name:'product', index:'product', width:80},
{name:'type', index:'type', width:55, align:'right'},
],
pager: '#pager',
rowNum:20,
viewrecords: true ,
caption: 'Positions',
height: '460',
loadonce:true,
hidegrid: false
});
更新 2:下面的 JSON 似乎有效 - 对吗?
{"page":0,"records":0,"total":0,"rows":[]}