jqgrid加载json数据时,后台有返回数据,而且有多少行就加载了多少行的表格,可是每行的数据都显示为空。
jqgrid设置:jQuery("#list1").jqGrid({rowNum:15,url:'/Authority/LoadStuffs',mtype:'POST',...
jqgrid设置:
jQuery("#list1").jqGrid({
rowNum: 15,
url: '/Authority/LoadStuffs',
mtype: 'POST',
datatype: "json",
jsonReader: {
root: "dataRows", page: "CurrentPage", total: "PageCount", records: "RecordCount", repeatitems: false
},
colNames: ['PageIndex', 'No', 'Name', 'Gender', 'Nation', 'Address', 'PoliticalStatus', 'CellPhoneNumber'],
colModel: [
{ name: 'PageIndex', index: 'PageIndex' },
{ name: 'No', index: 'No'},
{ name: 'Name', index: 'Name'},
{ name: 'Gender', index: 'Gender'},
{ name: 'Nation', index: 'Nation', align: "left" },
{ name: 'Address', index: 'Address', align: "left" },
{ name: 'PoliticalStatus', index: 'PoliticalStatus', align: "center" },
{ name: 'CellPhoneNumber', index: 'CellPhoneNumber', sortable: false }
],
rowList: [10, 20, 30],
pager: '#pager1',
sortname: 'PageIndex',
viewrecords: true,
caption: "Stuffs"
}); 展开
jQuery("#list1").jqGrid({
rowNum: 15,
url: '/Authority/LoadStuffs',
mtype: 'POST',
datatype: "json",
jsonReader: {
root: "dataRows", page: "CurrentPage", total: "PageCount", records: "RecordCount", repeatitems: false
},
colNames: ['PageIndex', 'No', 'Name', 'Gender', 'Nation', 'Address', 'PoliticalStatus', 'CellPhoneNumber'],
colModel: [
{ name: 'PageIndex', index: 'PageIndex' },
{ name: 'No', index: 'No'},
{ name: 'Name', index: 'Name'},
{ name: 'Gender', index: 'Gender'},
{ name: 'Nation', index: 'Nation', align: "left" },
{ name: 'Address', index: 'Address', align: "left" },
{ name: 'PoliticalStatus', index: 'PoliticalStatus', align: "center" },
{ name: 'CellPhoneNumber', index: 'CellPhoneNumber', sortable: false }
],
rowList: [10, 20, 30],
pager: '#pager1',
sortname: 'PageIndex',
viewrecords: true,
caption: "Stuffs"
}); 展开
若以下回答无法解决问题,邀请你更新回答
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询