Load the sheet on demand

Posted by: shanmukha.vangaru on 6 April 2022, 11:08 am EST

    • Post Options:
    • Link

    Posted 6 April 2022, 11:08 am EST

    Hi,

    I am loading the sheet using spread.fromJson() but it is taking long time around (5 secs) for loading the sheet if there are 500 rows and 750 columns. Is there a way to paint the sheet on scrolling the sheet ? like on demand painting the sheet ?

    Regards,

    Shanmukha Vangaru

  • Posted 7 April 2022, 6:57 am EST

    Hi,

    If I understand correctly you’re facing an issue while loading large json in a spread for this you you may use the spreadJs incremental loading feature. Please refer to the following demo and let me know if you face any issues.

    Incremental Loading Demo: https://www.grapecity.com/spreadjs/demos/features/workbook/incremental-loading/purejs

    is there a way to paint the sheet on scrolling the sheet ? like on demand painting the sheet ?

    this is supported by default spreadJS paints only that area which is visible to the user and repaints again when the user scrolls.

    Regards,

    Avinash

  • Posted 8 April 2022, 5:53 am EST

    Hi,

    Thanks for the clarification on painting the sheet. I would like to know is there any default implementation which makes a api call and updates the json and repaint the sheet on scrolling the sheet ?

    Regards,

    Shanmukha Vangaru

  • Posted 19 April 2022, 12:42 am EST

    Hi Shanmukh,

    For this, you may use the table sheet feature of spreadJS. Please refer to the following demo and let me know if you face any issues.

    
    //init a data manager
    var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), {sheetCount: 0});
    var dataManager = spread.dataManager();
    var myTable = dataManager.addTable("myTable", {
        remote: {
            read: {
                url: 'https://demodata.grapecity.com/northwind/api/v1/Orders'
            }
        }
    });
    
    //init a table sheet
    var sheet = spread.addSheetTab(0, "TableSheet1", GC.Spread.Sheets.SheetType.tableSheet);
    
    //bind a view to the table sheet
    myTable.fetch().then(function () {
        var view = myTable.addView("myView");//the View has all default columns of the Table
        sheet.setDataView(view);
    });
    
    

    tablsheet feature: https://www.grapecity.com/spreadjs/demos/features/table-sheet/overview/purejs

    Regards,

    Avinash

Need extra support?

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

Learn More

Forum Channels