我的 JqGrid 代码如下所示
$('#grid').jqGrid({
url: '',
scroll: 1,
postData: {
...
},
datatype: "json",
mtype: 'POST',
colNames: [....],
colModel: [{
name: 'source',
index: 'source',
width: '100',
align: 'center',
stype: 'select',
searchoptions: {
dataUrl: 'getSource'
}
}, { ...
}],
rowNum: 200,
height: '450px',
autowidth: false,
shrinkToFit: true,
rownumbers: true,
pager: '#table-page',
sortname: '...',
viewrecords: true,
sortorder: 'asc',
caption: "Records",
emptyrecords: "Empty records",
loadonce: false,
loadComplete: function() {
....
},
jsonReader: {
....
}
});
当我缓慢滚动网格并达到 200 时,网格会重新加载,但 View 显示 2000 中的 View 1-400。
如果我继续缓慢滚动,那么我会看到 2000 个 View 中的第 1-600 个 View 。
我们还可以在演示 http://www.trirand.com/blog/jqgrid/jqgrid.html 中看到这一点-> 3.7 中的新增功能 -> True Scrolling 并看到相同的错误。
有人可以建议我一个解决方法吗?
最佳答案
它按设计工作......如果您缓慢滚动,它会向表中添加记录 - 因此您可以向上滚动,数据仍然存在 - 如果您快速滚动,则当前数据将被删除,并且仅使用添加新数据您在与滚动位置匹配的起始点指定的行数
关于jquery - JQGrid真实滚动问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11105772/