How to implement a lazy loading algorithm

Tags: #<Tag:0x00007efc6abafc08>

I’m trying to implement a lazy loading algorithm and my current approach is to use an afterScrollVertically handler. In this handler I have problems to determine the current visible rows. Have you an idea how I could solve the problem?

Here’s my code snippet:

 var compute_window = function(e) {
   
      var rows = hot.getAllRowsInViewPort();    
      console.log("rows in viewport: " + rows);
    };
   
    settings1 = {
        startRows: nRows,
        startCols: nColumns,
        rowHeaders: true,
        colHeaders: columnDefs,
        columnHeaderHeight: 150,
        data: rowData,
        afterScrollVertically: compute_window,    
        colHeaders: colHeaderRenderer
    };
   
    hot = new Handsontable(hotElement, settings1);

Hi @hilger.steenblock

I think that getLastVisibleRow (a part of AutoRowSize plugin) should be what you are looking for.

Demo: http://jsfiddle.net/1w1rxw9v/

Hi @aleksandra_budnik
Thank you very much - very useful example.

You’re welcome.

I guess that we can close the topic.