How to get x,y co-ordinates of a cell which is not in Viewport

Posted by: nchalla on 2 July 2019, 6:30 pm EST

    • Post Options:
    • Link

    Posted 2 July 2019, 6:30 pm EST

    Hi,

    Is there any way to get the X, Y coordinates of a cell which is not in the viewport. getCellRect() is not working if the cell is not in the viewport.

    Thanks.

  • Posted 3 July 2019, 3:43 pm EST

    Hi,

    Since the cell is currently not visible, X,Y coordinates for the cell doesn’t yet so we couldn’t get X,Y coordinates of the non-visible cell. Could you please explain your use case in detail so that we could suggest you the best possible alternative

    Regards

  • Posted 3 July 2019, 5:04 pm EST

    I’m trying to add a floating object or a picture while loading the sheet. But I need to add it at the bottom of the sheet which is not in the viewport. Please let me know if there is a way to do it.

  • Posted 4 July 2019, 6:27 pm EST

    You may set the startRow()/startColumn() of floating object to display at the position which is currently not visible.

    Please refer to the following code snippet and the attached sample demonstrating the same:

    // images
    var picture = sheet.pictures.add("f2", "https://www.grapecity.com/demos/spread/JS/TutorialSample/images/spreadLogo.png", 0, 0, 100, 100);
    picture.backColor("black");
    // move image to cell(30, 15)
    picture.startRow(30);
    picture.endRow(picture.endRow() + 30);
    picture.startColumn(15);
    picture.endColumn( picture.endColumn() + 15);
    

    floatingObjects.zip

  • Posted 4 July 2019, 8:35 pm EST

    Thanks. It helped.

Need extra support?

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

Learn More

Forum Channels