Javascript jqGrid未在滚动上加载数据(Internet Explorer)
我遇到了一个与以下问题非常相似的问题: JQgrid的“populateVisible”函数从未执行网格的populate方法(可能它不认为要填充的项是“可见的”,因为某些IE不一致) 我将粘贴下面函数的一个片段以用于某些上下文:Javascript jqGrid未在滚动上加载数据(Internet Explorer),javascript,jquery,ajax,internet-explorer,jqgrid,Javascript,Jquery,Ajax,Internet Explorer,Jqgrid,我遇到了一个与以下问题非常相似的问题: JQgrid的“populateVisible”函数从未执行网格的populate方法(可能它不认为要填充的项是“可见的”,因为某些IE不一致) 我将粘贴下面函数的一个片段以用于某些上下文: populateVisible: function() { var dh = $(grid.bDiv).height(); var table = $("table:first", grid.bDiv); ....
populateVisible: function() {
var dh = $(grid.bDiv).height();
var table = $("table:first", grid.bDiv);
....
var tbot = ttop + table.height();
....
var page, npage, empty;
if ( tbot < dh && ttop <= 0 &&
(p.lastpage===undefined||parseInt((tbot + scrollTop + div - 1) / div,10) <= p.lastpage))
{
npage = parseInt((dh - tbot + div - 1) / div,10);
if (tbot >= 0 || npage < 2 || p.scroll === true) {
page = Math.round((tbot + scrollTop) / div) + 1;
ttop = -1;
} else {
ttop = 1;
}
}
....
if (npage) {
if (p.lastpage && page > p.lastpage || p.lastpage==1 || (page === p.page && page===p.lastpage) ) {
return;
}
if (grid.hDiv.loading) {
grid.timer = setTimeout(grid.populateVisible, p.scrollTimeout);
} else {
p.page = page;
if (empty) {
grid.selectionPreserver(table[0]);
grid.emptyRows.call(table[0], false, false);
}
grid.populate(npage);
}
}
}
populateVisible:function(){
var dh=$(grid.bDiv).height();
var table=$(“table:first”,grid.bDiv);
....
var tbot=ttop+table.height();
....
变量页,npage,空;
如果(tbot
问题是“tbot编辑:删除了许多问题上下文中不必要的代码。有关整个函数,请参见此处:您提供了相当多的代码。我们可以更轻松地帮助您简化测试用例。感谢Anton的关注。我删除了很多问题不需要的代码。这里可以看到完整的上下文: