Copy/Paste Object/Arrays

Posted by: johnny.su on 18 July 2018, 9:18 am EST

  • Posted 18 July 2018, 9:18 am EST

    Hi,

    It doesn’t seem like it’s possible to copy/paste objects or arrays . I tried overwriting the copy handler to copy the object/array value instead of the string representation but the wijmo.Clipboard.copy function only accepts string.

    Is there a way that I’m not aware of that allow you to copy and paste object/arrays?

    Regards,

    Johnny

  • Posted 18 July 2018, 9:08 pm EST

    Hi,

    Wijmo Clipboard support only text type so if you need to transfer arrays/objects then you may use JSON.stringify()/JSON.parse() to convert JSON to text format or vice versa.

    //please refer to following code-snippet

    grid.copying.addHandler((s,e)=>{
     
     
    let jsonData={"msg":"this is json"};
    let text=JSON.stringify(jsonData);
    //copy to clipboard
    wijmo.Clipboard.copy(text);
    //stop default copy behaviour
    e.cancel=true;
     
     
    });
    

    ~Manish

  • Posted 19 July 2018, 2:56 am EST

    I will give that a try. Thanks!

Need extra support?

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

Learn More

Forum Channels