Set active cell in selection going backwards

Posted by: razeris563 on 25 September 2021, 7:07 am EST

    • Post Options:
    • Link

    Posted 25 September 2021, 7:07 am EST - Updated 3 October 2022, 9:37 am EST

    Greetings,

    I would like to ask about setting an active cell in selection since i couldn’t find it anywhere. I’ve implemented this custom functionality that works with the shortcut ctrl/command + shift + directional arrow key in excel or google sheets (you can try it out). What it does, it selects the nearest non-empty cell value all the way from the initial selected cell or selected area.

    My huge problem is that i’m unable to set the active cell to the initial selected cell and it keeps hopping all over the place. There should be some trick with clearSelection() and repaint() but i’ve got no idea how to do this.

    Example shown on the images.

    PS: This problem of course happens only when i’m going “backwards” meaning to left and up direction.

  • Posted 27 September 2021, 6:39 am EST

    Hi,

    Please refer to the following sample that demonstrates how we could implement these shortcuts in SJS.

    sample: https://codesandbox.io/s/nostalgic-sound-5reue?file=/src/index.js

    Regards

    Avinash

Need extra support?

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

Learn More

Forum Channels