Ctrl-C with Row selection

Posted by: vlad.tovbin on 12 October 2019, 8:47 pm EST

    • Post Options:
    • Link

    Posted 12 October 2019, 8:47 pm EST

    I’ve upgraded to the latest version of Wijmo FlexGrid, and copy (Ctrl-C) behavior has changed in the new version. When I have ‘row’ selection mode, it copies the entire row instead of the highlighted cell.

    Is it possible to change this behavior ? My app is in use, and it’ll impact a number of people who are used to it working the old way, where it Ctrol-C copies only the highlighted cell.

    Thanks

  • Posted 14 October 2019, 12:15 am EST

    Hi,

    This is expected behavior since FlexGrid copies all the cells which are currently in a selected state or multi-selected state. But if you wish to select only the active cell, then you will need to handle the copying event of FlexGrid and use the Clipboard.copy to copy the cell data. Please refer to the code snippet and the sample below:

    var grid = new wjcGrid.FlexGrid('#grid', {
      itemsSource: getData(),
      selectionMode: 'Row',
      copying: function(s, e) {
        e.cancel = true;
        const data = s.getCellData(s.selection.row, s.selection.col, true);
        wjcCore.Clipboard.copy(data);
      }
    });
    

    https://stackblitz.com/edit/js-5lp14e

    Also, could you please let me know the version which you were using before upgrading?

    Regards,

    Ashwin

  • Posted 21 October 2019, 3:23 pm EST

    This worked well, thank you Ashwin !

    Older version was 5.2.

Need extra support?

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

Learn More

Forum Channels