Skip to content

Commit d7a666c

Browse files
committed
Merge pull request #4365 from DmitryEfimenko/infinite-scroll-bug-fix
fix(infinite-scroll): load more data if needed
2 parents 9d1a0b4 + 65a541f commit d7a666c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/features/infinite-scroll/js/infinite-scroll.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,12 @@
368368

369369
newVisibleRows = grid.getVisibleRowCount();
370370

371+
// in case not enough data is loaded to enable scroller - load more data
372+
var canvasHeight = rowHeight * newVisibleRows;
373+
if (grid.infiniteScroll.scrollDown && (viewportHeight > canvasHeight)) {
374+
grid.api.infiniteScroll.raise.needLoadMoreData();
375+
}
376+
371377
if ( grid.infiniteScroll.direction === uiGridConstants.scrollDirection.UP ){
372378
oldTop = grid.infiniteScroll.prevScrollTop || 0;
373379
newTop = oldTop + (newVisibleRows - grid.infiniteScroll.previousVisibleRows)*rowHeight;

0 commit comments

Comments
 (0)