Visible method to get the cell visibility

Posted by: davide.vago on 24 October 2019, 6:36 am EST

  • Posted 24 October 2019, 6:36 am EST

    Good morning/afternoon

    I’m writing in regards of the visible method within the CellRange type

    (https://help.grapecity.com/spread/SpreadSheets12/webframe.html#SpreadJS~GC.Spread.Sheets.CellRange~visible.html)

    I’ve been setting a specific cell (not a row or a column) using .visible(false) and I would to retrieve the visibility of the single cell.

    Do you have anything available that I can use?

    Looking forward to hearing from you

  • Posted 25 October 2019, 2:10 am EST

    Hi Davide,

    SpreadJS do not support hiding a single cell. The visible method on the CellRange is to allow setting visibility for of rows/columns like:

    sheet.getRange(-1,  colIndex, -1, colCount).visible(false);
    sheet.getRange(rowIndex, -1, rowCount, -1).visible(false);
    

    So to get if a cell is visible or not, you need to check if the cells row and column are visible or not. Please refer to the following code snippet:

    function isCellVisible(sheet, rowIndex, colIndex){
        return sheet.getColumnVisible(colIndex) && sheet.getRowVisible(rowIndex);
    }
    

    Regards

    Sharad

Need extra support?

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

Learn More

Forum Channels