0
我有以下格式的數據,當綁定時,我的空行在我的jqGrid
。我的數據類型應該是什麼,或者我怎樣才能避免使用jsonReader
,以便默認處理它。jqGrid數據格式和jsonReader
我的網架結構,
$("#UserReportGrid").jqGrid({
datatype: 'local',
data: data,
colNames: colNames,
colModel: colNames,
localReader: {
repeatitems: true,
cell: "",
id: 0, root: "data",
},
rowNum: 10,
rowList: [10, 25, 50, 100],
pager: '#GridPager',
caption: "User Details",
height: 'auto',
sortname: 'SNo',
gridview: true
});
我都試過了,
JSON.parse(data) resulted in exception
JSON.parse(JSON.stringify(data)) resulted in same no records are displayed
只需從設置中刪除localReader,並確保您已設置密鑰:colModel中的true以標識將充當id的列。數據應該是對象的數組,並且不需要JSON.parse –