Switch Tab Hot Key

Posted by: jeff on 9 March 2020, 12:30 am EST

  • Posted 9 March 2020, 12:30 am EST

    Can you make switch tabs hot key worke like Excel?

    Please make this work for both mac and PC.

    https://www.quora.com/What-is-the-keyboard-shortcut-to-switch-between-tabs-in-Excel

  • Posted 9 March 2020, 3:18 am EST

    Hi Jeff,

    We could easily set the shortcuts for a command using the setShortcutKey() method like:

    commandManager.setShortcutKey(

    “commandName”,

    keyCode,

    ctrl,

    shift,

    alt,

    meta

    );

    However, depending on the browser, some events can’t be intercepted by the web apps, ctrl+pageup/ctrl+pagedown is one such event so we cannot use this combination for changing the sheets. I would suggest you use some other combination like alt+ArrowLeft/alt+ArrowRight as shortcuts to switch sheets. Please refer to the following code snippet:

    const commandManager = spread.commandManager();
      commandManager.setShortcutKey(
        "navigationNextSheet",
        GC.Spread.Commands.Key.right,
        false,
        false,
        true,
        false
      );
      commandManager.setShortcutKey(
        "navigationPreviousSheet",
        GC.Spread.Commands.Key.left,
        false,
        false,
        true,
        false
      );
    

    API reference:

    • setShortcutKey Method: https://www.grapecity.com/spreadjs/docs/v13/online/SpreadJS~GC.Spread.Commands.CommandManager~setShortcutKey.html

    Regards

    Sharad

Need extra support?

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

Learn More

Forum Channels