我使用jqGrid显示一些json数据,但是当我运行代码并且在控制台中收到 no error 消息时,网格没有显示任何内容。
这是我的js代码:
$("#gridWall").jqGrid({
datatype: 'json',
data: data,
colNames: ['Id', 'Title', 'Artist', 'ISRC'],
colModel: [
{name: 'Id', index: 'music_video_id', width: 100, editable: false},
{name: 'Title', index: 'title', width: 150, editable: false},
{name: 'Artist', index: 'artist_name', width: 200, editable: false},
{name: 'ISRC', index: 'isrc', width: 150, editable: false}
],
pager: '#gridpagerWall',
loadonce: true,
rowNum: 100,
rowList: [100, 200, 300],
sortname: 'title',
sortorder: 'asc',
jsonReader: {
repeatitems: true,
root: "contents",
page: '1',
total: "number"
},
viewrecords: true,
gridview: true,
hidegrid: false,
caption: 'Wall builder',
editUrl: 'clientArray',
})
我的JSON数据是这样的:
{"number":50,"type":5,"contents":[{"title":"xxx","isrc":"xxx","artist_name":"xx","music_video_id":"1"},...]}
有谁知道如何解决我的问题? 感谢