How to make possible to cut in FlexGrid (with shortcut CTRL + X)

Posted by: bozjator on 11 November 2019, 2:42 am EST

    • Post Options:
    • Link

    Posted 11 November 2019, 2:42 am EST

    Hi,

    is there a way to enable cutting (with CTRL + X) in the FlexGrid, the same way i can copy by CTRL + C?

    Regards

  • Posted 12 November 2019, 6:21 pm EST

    Hi,

    You will need to handle the ‘keyup’ event of the FlexGrid and then cut the data from the FlexGrid:

    grid.hostElement.addEventListener('keyup', function(e) {
      if(e.ctrlKey && e.key === 'x') {
        const data = grid.getClipString();
        wjcCore.Clipboard.copy(data);
        grid.setClipString('');
      }
    }, true)
    

    You may refer to the sample link below:

    https://stackblitz.com/edit/js-brssdp

    Please note that if a column is required (number and date types column are required by default), then the data of that column will not be removed from the FlexGrid.

    Regards,

    Ashwin

Need extra support?

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

Learn More

Forum Channels