0

I've tried to look this up a few days now but came out empty handed I have a little website I'm working on and I've created a context menu (right click on a table row to get the context menu) and I wish to create a copy to clipboard method, I've a the data I wish to copy on a variable named $text This is the JS code:

copy: {
    name: "Copy",
    callback: function (key, option) {
    var $row = $(this).closest("tr");
    var $text = $row.find(".md").text();
    
    //the $text is what I'm trying to copy
    }

I've tried many method to do so, using JS only and when I didn't find any method to do so I've tried to find a way to send this variable to my init.py code which runs the server but without success.

I would very apprachet if anyone will be able to help me understand what am I looking for to make this work and how to implement it.

Thank you very much

davidism
  • 98,508
  • 22
  • 317
  • 288
Elon Salfati
  • 1,047
  • 3
  • 18
  • 39
  • 1
    I'm afraid that the Flask Backend has nothing to do with copying data to the user clipboard. – VMRuiz Apr 28 '17 at 09:39
  • 1
    You can find more information about copy with Javascript in this post: http://stackoverflow.com/questions/400212/how-do-i-copy-to-the-clipboard-in-javascript – VMRuiz Apr 28 '17 at 09:40
  • I saw this post but here they give this idea to make a pop-up with a place from which you can copy, I hope that after clicking the Copy tab it would just save the part of the table I want to the clipboard (which I already got into $text) – Elon Salfati Apr 28 '17 at 09:40
  • OHHHH GOD I've got it, I didn't see the next part where he explained the way to it without the pop-up, You are awesome! – Elon Salfati Apr 28 '17 at 09:58

0 Answers0