Loading a template on a new tab

Posted by: vleilamitchell on 31 May 2018, 1:24 pm EST

    • Post Options:
    • Link

    Posted 31 May 2018, 1:24 pm EST

    I’ve captured the new tab creation with the following code I found in another thread:

            spread.bind(GC.Spread.Sheets.Events.SheetTabClick, function (e, info) {
                if (info.sheet === null && info.sheetName === null) {
                      console.log("Detected new sheet.");
                      spread.getActiveSheet().fromJSON(template);
                }
               });
    

    The issue is that the second line which attempts to load the template doesn’t function correctly. Am I missing something?

  • Posted 1 June 2018, 4:52 am EST

    Hello,

    Please have a look at attached sample wherein on tab click event we are copying one sheet to another ( just like loading template) using toJSON & fromJSON methods.

    Hope it helps.

    Thanks,

    Reeva

    SheetTabClick_V11.zip

  • Posted 1 June 2018, 6:11 pm EST

    Thanks for the reply but the functionality that I am looking for is adding a new tab instead of clicking on an existing tab. The function seems to not copy the data to the target tab either.

  • Posted 11 June 2018, 5:52 am EST

    Hello,

    Please go through this blog post for the same:-

    https://www.grapecity.com/en/blogs/easy-to-use-json-template-in-spreadjs

    Hope it helps.

    Thanks,

    Reeva

Need extra support?

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

Learn More

Forum Channels