Jqgrid 4.5 virtaul滚动在向下滚动时未发送请求



我使用的是Jqgrid 4.5。我的网格使用javascript在页面加载时绑定良好。我启用了虚拟滚动,但当我向下滚动时,页面不会向服务器发出新的请求。臭名昭著的是什么都不做。只要坚持页面加载时的记录即可。我不知道哪里出了问题,我使用了网上找到的所有解决方案,但无法工作。我绑定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 }
        });

指出我做错了什么,因为我的需求需要虚拟滚动,而我无法使其工作。

我自己解决了这个问题,因为我在jqgrid中设置了错误的分页选项,这就是它产生问题的原因。现在一切正常。

最新更新