我正在使用Jqgrid 4.5。我的网格使用javascript在页面加载上很好地绑定。我启用虚拟滚动但当我向下滚动页面时没有向服务器发出新请求。 inface它什么都不做。只需坚持页面加载的记录。我不知道我哪里出错了我使用网上找到的所有解决方案但无法工作。我绑定JqGrid的代码是:
jQuery("#list2").jqGrid(
{
url: '../ReportsLoadService.asmx/GetPublishHistory',
datatype: "json",
ajaxGridOptions: { contentType: "application/json" },
mtype: "POST",
postData:
{
//Sortby: Sortby,
//sidx: sidx,
//page: page,
//rows: rows,
PostProfileId: PostProfileId,
startdate: startdate,
starttime: starttime,
enddate: enddate,
endtime: endtime,
ServiceName: ServiceName,
Url: Url,
UrlTitle: UrlTitle,
Status: Status,
DateOption: DateOption
},
serializeGridData: function(data) {
return JSON.stringify(data);
},
colNames: [
'Service Name', 'Title', 'Schedule Date', 'Status', 'Posting Error'
],
colModel: [
{
name: 'ServiceName',
index: 'ServiceName',
resizable: false
},
{
name: 'Title',
index: 'Title',
formatter: 'showlink',
formatoptions: { baseLinkUrl: 'Url', addParam: '', idName: '' },
resizable: false
},
{
name: 'ScheduleDate',
index: 'ScheduleDate',
align: 'center',
resizable: false
},
{
name: 'Status',
index: 'amount',
resizable: false
},
{
name: 'PostingError',
index: 'PostingError',
resizable: false
}
],
jsonReader: {
root: "d.Records",
page: "d.CurrentPage",
//records: "d.TotalRecords",
repeatitems: false
},
rowNum: 50,
rownumbers: true,
//rowList: [20, 30, 50],
//sortname: "Title",
//rowTotal: 2000,
pager: '#pager2',
viewrecords: true,
sortorder: "desc",
//height: "100%",
//autowidth: true,
scroll: 1,
loadonce: false,
gridview: true,
prmNames: { npage: 1 }
});
指出我在哪里做错了,因为我的要求需要虚拟滚动而我无法使其正常工作。
答案 0 :(得分:0)
我自己解决了我在jqgrid中设置了错误的分页选项,这就是为什么它会产生问题。现在它的工作正常。