Issue getting spreadsheet object from page

Posted by: keith.emanuel on 26 February 2019, 2:25 am EST

    • Post Options:
    • Link

    Posted 26 February 2019, 2:25 am EST

    Hello,

    I’m trying to automate some SpreadJS v10 interaction. It seems like the best way to do it would be using JS. I’ve searched the forum and found a few topics that sound like what I need to do:

    https://www.grapecity.com/en/forums/spread-sheets/how-can-you-get-an-instanc

    https://www.grapecity.com/en/forums/spread-sheets/how-to-make-the-cell-edita

    However, I haven’t been able to actually create or retrieve the instance of the workbook/sheets from the page. findControl just doesn’t throw an error or return a value. I’m looking at the minified JS also when running the code, so it’s hard to debug.

    My question is, what element should I be supplying to the findControl function?

  • Posted 26 February 2019, 4:35 pm EST

    Hello,

    You can use the findControl method as shown here:

    var spread =new GC.Spread.Sheets.findControl(document.getElementById(‘ss’));

    where ‘ss’ is the id of Spread div.

    I hope it helps.

    Thanks,

    Deepak Sharma

  • Posted 27 February 2019, 1:52 am EST

    Thanks, that worked! It turns out I was missing the ‘new’ keyword. Some other examples I saw didn’t have it there.

Need extra support?

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

Learn More

Forum Channels