Block CopyPaste in Non-editable and read-only cells

Tags: #<Tag:0x00007efc609d22a0> #<Tag:0x00007efc609d2138>

Good day.

I am working on a behavior where in cells are set as read-only and non-editable on certain conditions. Part of the requirement is to not allow adding values on disabled fields via copy paste. I’ve read in the documentation that copy paste is still doable even cells are disabled. Is it possible to block it programmatically (like custom renderer or such)?

Thanks!

Hi @karlytebia

Yes, it’s partially possible. You need to use beforeChange hook to restrict paste operation on the disabled cells, however, the copy action will be still available. Is that solution enough for your needs?

In this example the first column has disabled cells and you can’t paste any value there:

https://jsfiddle.net/handsoncode/d47fjaqh/

Thanks for the advice. Will try your suggestion and see if it will work. thank you.

Update: the solution works. thank you!