Skip to content

Commit 65a541f

Browse files
fix(infinite-scroll): load more data if needed
detect if more data needs to be loaded after the initial load. Before if not enough data was loaded to enable scrolling, no more data would be loaded. Resolves issue [4363](#4363)
1 parent 880ce19 commit 65a541f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

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

+6
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)