Skip to content

Commit

Permalink
If the server ever returned no data, populateVisible had trouble gett…
Browse files Browse the repository at this point in the history
…ing going again
  • Loading branch information
markw65 committed Nov 18, 2009
1 parent bdb329e commit 047cda9
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions js/grid.base.js
Expand Up @@ -269,7 +269,9 @@ $.fn.jqGrid = function( pin ) {
var tbot = ttop + table.height();
var div = rh * rn;
var page, npage, empty;
if (ttop <= 0 && tbot < dh && parseInt((tbot + scrollTop + div - 1) / div) < p.lastpage) {
if (ttop <= 0 && tbot < dh &&
(p.lastpage==null||parseInt((tbot + scrollTop + div - 1) / div) < p.lastpage))
{
npage = parseInt((dh - tbot + div - 1) / div);
if (tbot >= 0 || npage < 2 || p.scroll === true) {
page = parseInt((tbot + scrollTop) / div) + 1;
Expand All @@ -285,7 +287,7 @@ $.fn.jqGrid = function( pin ) {
}

if (npage) {
if (page > p.lastpage) {
if (p.lastpage && page > p.lastpage) {
return;
}
if (grid.hDiv.loading) {
Expand Down Expand Up @@ -367,7 +369,7 @@ $.fn.jqGrid = function( pin ) {
} else { ii="";}
$("<div class='ui-widget-overlay jqgrid-overlay' id='lui_"+this.id+"'></div>").append(ii).insertBefore(gv);
$("<div class='loading ui-state-default ui-state-active' id='load_"+this.id+"'>"+this.p.loadtext+"</div>").insertBefore(gv);
$(this).attr({cellSpacing:"0",cellPadding:"0",border:"0","role":"grid","aria-multiselectable":this.p.multiselect,"aria-labelledby":"gbox_"+this.id});
$(this).attr({cellSpacing:"0",cellPadding:"0",border:"0","role":"grid","aria-multiselectable":!!this.p.multiselect,"aria-labelledby":"gbox_"+this.id});
var sortkeys = ["shiftKey","altKey","ctrlKey"],
IntNum = function(val,defval) {
val = parseInt(val,10);
Expand Down Expand Up @@ -1441,9 +1443,10 @@ $.fn.jqGrid = function( pin ) {
ts.grid.bDiv.scrollTop = 0;
}
}
if (ts.grid.prevRowHeight && ts.p.scroll)
if (ts.grid.prevRowHeight && ts.p.scroll) {
delete ts.p.lastpage;
ts.grid.populateVisible();
else
} else
ts.grid.populate();
return false;
});
Expand Down

0 comments on commit 047cda9

Please sign in to comment.