示例来自http://www.trirand.net/demo/javascript/jqgrid/loading_data/scrollbar/index.html
Guriddo jqGrid JS 的版本:4.7.0 和 4.7.1。添加 gridview: true
以重复错误
(function ($) {
'use strict';
$(function () {
$('#jqGrid').jqGrid({
url: 'http://trirand.com/blog/phpjqgrid/examples/jsonp/getjsonp.php?callback=?&qwery=longorders',
mtype: 'GET',
datatype: 'json',
page: 1,
colNames: ['Order ID', 'Customer ID', 'Order Date', 'Freight', 'Ship Name'],
colModel: [{
name: 'OrderID',
key: true,
width: 75
}, {
name: 'CustomerID',
width: 150
}, {
name: 'OrderDate',
width: 150
}, {
name: 'Freight',
width: 150
}, {
name: 'ShipName',
width: 150
}],
width: 750,
height: 250,
rowNum: 20,
gridview: true,
scroll: 1, // set the scroll property to 1 to enable paging with scrollbar - virtual loading of records
emptyrecords: 'Scroll to bottom to retrieve new page', // the message will be displayed at the bottom
pager: '#jqGridPager'
});
});
})(jQuery);
当您选择页面 X
上的某些复选框并向下滚动,然后返回页面 X
时,复选框将变为未选中状态,但仍会应用选择,并且 .jqGrid('getGridParam', 'selarrrow')
返回选定的行。仅当 gridview: true
时才会出现此问题。我做了一些demo screencast重复的错误。
最佳答案
我可以确认这是 jqGrid 4.7 和免费 jqGrid 4.8 中的错误。
我在 free jqGrid 中修复了问题(参见here)。 The demo使用来自 github 的当前源,并且在使用虚拟滚动的情况下复选框的状态没有问题。
关于javascript - 使用 gridview 滚动后,jqgrid 的多个复选框已取消选中 : true,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29121235/