Display blank rows on scroll?

Posted by: datta on 28 May 2019, 2:15 am EST

  • Posted 28 May 2019, 2:15 am EST

    Hi in MS-excel once you scroll it keeps appending blank rows . Is there any such features in SpreadJS

  • Posted 29 May 2019, 1:58 am EST

    Hi,

    We could achieve the required functionality by handling the TopRowChanged/LeftColumnChanged event and adding extra rows if reach near the end of the sheet. Please refer to the following code snippet and the attached sample which demonstrates the same:

    function enableInfinitScroll(sheet){
                sheet.bind(GC.Spread.Sheets.Events.TopRowChanged, function(){
                    // check if we are near to the end of the sheet
                    var bottomRowIndex = sheet.getViewportBottomRow(1);
                    if(bottomRowIndex >= sheet.getRowCount() - 10){
                        sheet.setRowCount(sheet.getRowCount() + 4);
                    }
                });
    
                sheet.bind(GC.Spread.Sheets.Events.LeftColumnChanged, function(){
                    // check if we are near to the end of the sheet
                    var bottomRowIndex = sheet.getViewportRightColumn(1);
                    if(bottomRowIndex >= sheet.getColumnCount() - 3){
                        sheet.setColumnCount(sheet.getColumnCount() + 2);
                    }
                });
            }
    

    ~sharadspreadInfiniteScroll.zip

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels