Prevent pasting in columns without marking them as read-only

Posted by: meet.shah on 12 March 2018, 11:27 am EST

    • Post Options:
    • Link

    Posted 12 March 2018, 11:27 am EST

    I have read the documentation and it says pasting is disallowed in readonly columns, however is there a way to prevent pasting in columns without marking them as readonly.

  • Posted 13 March 2018, 1:39 am EST

    You can handle the pastingCell event and cancel the event for certain columns to prevent pasting.

    grid.pastingCell.addHandler((s,e)=>{

    if(e.col==0){

    e.cancel=true;

    console.log(“pasting cancelled”);

    }

    });

    Here is a working fiddle sample:- http://jsfiddle.net/mjx1by04/

Need extra support?

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

Learn More

Forum Channels