Flexgrid - Vue 2- How to cancel paste based on number of rows being pasted?

Posted by: daryn.holmes on 1 March 2018, 2:21 am EST

  • Posted 1 March 2018, 2:21 am EST

    Hi,

    We would like to cancel a paste, if the user is pasting more than 300 rows. How can we tell how many rows are being pasted before the paste occurs?

    We tried the pasting event, however the data is undefined.

    We would also like to know how can we cancel a copy, if the user has selected more than 300 rows.

    Thanks, Daryn

  • Posted 1 March 2018, 3:20 am EST

    Hi Daryn,

    You may use pastingCell event to cancel pasting for specific cell.

    You may also get the data to be pasted using standard paste event using below code:

    grid.hostElement.addEventListener('paste', function(e){
         // Fetch data using clipboard
    },true);
    

    ~Manish

  • Posted 1 March 2018, 3:53 am EST

    Thanks,

    Could you please give me a working example of how to use:

    grid.hostElement.addEventListener('paste', function(e){
         // Fetch data using clipboard
    },true);
    

    Thanks, Daryn

  • Posted 1 March 2018, 3:55 am EST

    What other code needs to be in this function?

    Can you show what we need to do to cancel the paste, and what to do to continue the paste?

  • Posted 4 March 2018, 6:20 pm EST

    Hi,

    The parameter is of Type EventArgs - http://demos.wijmo.com/5/Angular/WijmoHelp/WijmoHelp/topic/wijmo.EventArgs.Class.html

    You can cancel the event if you want to disable the paste and set it to False if you want to enable it.

    grid.hostElement.addEventListener('paste', function(e){
         e.cancel=true;
    },true);
    
Need extra support?

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

Learn More

Forum Channels