jqgrid 不能通过设置 jsonReader 工作,重复项:false
首先我的 jqgrid 是按数组获取数据
$(listvar).jqGrid({
}
$responce = new stdClass();
$responce -> page = $page;
$responce -> total = $total_pages;
$responce -> records = $count;
$responce -> rows[$num]['id'] = $row["id"];
$responce -> rows[$num]['cell']= array("fid" => $row['fid'], "fname" => $row['fname']);
echo json_encode($responce);
它工作正常;;但我想通过键值; 然后我更改代码,以便 jqgrid 可以通过键值方式获取数据;我参考
和
http://www.trirand.com/jqgridwiki/doku.php?id=wiki:retrieving_data#json_data
$(listvar).jqGrid({
enter code here`jsonReader : {
repeatitems : false,
//others default value;
},
}
我的代码:
$responce = new stdClass();
$responce -> page = $page;
$responce -> total = $total_pages;
$responce -> records = $count;
$responce -> rows[$num]['id'] = $row["id"];
$responce -> rows[$num]['cell']= array("fid" => $row['fid'], "fname" => $row['fname']);
echo json_encode($responce);
:网络回复;
{"page":"1","total":1,"records":"1","rows":{"id":1,"cell": [{"fid":"153","fname":"\u624b\u673a"}]}}
但是jqgrid不能显示数据;问题是什么 ?