Unable to Delete the Rows & Columns

Posted by: praneeth.pannala on 1 July 2020, 1:44 am EST

  • Posted 1 July 2020, 1:44 am EST

    Hi Team,

    I have created an headless workbook and wanted to delete all the hidden rows and columns from sheet.

    Here is my code

    
            const numRows = sheet.getRowCount();
            const numColumns = sheet.getColumnCount();
            for (let i = 0; i < numColumns; i++) {
                if (!sheet.getColumnVisible(i)) {
                    sheet.deleteColumns(10, 2);
                    i = -1;
                }
            }
    
            for (let i = 0; i < numRows; i++) {
                if (!sheet.getRowVisible(i)) {
                    sheet.deleteRows(i, 1);
                    i = -1;
                }
            }
    
    

    This code used to work in v12 of spread js

    But recently i have upgraded my grapecity spread js to v13 and from thereon these functions arent working.

    Can you please help me out? Was there any issue in spreadjs v13 or am i missing something in the process?

  • Posted 2 July 2020, 12:23 am EST

    Hi Praneeth,

    Apart from some optimization, nothing seems to be the issue in the code snippet.

    Could you please let us know what is the exact issue you are facing? Are there any errors on the dev console?

    Also, please make sure that the rows/columns are actually hidden and not just size is set to 0.

    If the issue persists please share a small sample replicating the issue so that we could further investigate it.

    Regards

Need extra support?

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

Learn More

Forum Channels