picyka Posted March 16, 2022 Share Posted March 16, 2022 with btnCopiarResumo, JSInterface do JSAddListener('click', JSFunction('sender', 'var textarea = document.getElementById(' + UniMemoResumo.JSName + '.inputId); ' + 'textarea.select(); ' + 'document.execCommand(''copy'');')); Currently I use this routine to copy text from a memo, it works very well. I would like that, when the person clicked on the button, before I copied the text, I could go to the server, and feed the memo, I would have to execute it on the server before executing the JS click. can i do it? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted March 16, 2022 Share Posted March 16, 2022 Hello, Sorry, your question is not very clear. Could you please explain in more detail? Quote Link to comment Share on other sites More sharing options...
picyka Posted March 16, 2022 Author Share Posted March 16, 2022 function click(sender, e, eOpts) { Ext.defer(function(){ ajaxRequest(sender, '_beforeClick', []) }, 5); var textarea = document.getElementById(UniMemoResumo.JSName + '.inputId); textarea.select(); document.execCommand(''copy''); } Before copying the text of the memo, I need to feed it. Quote Link to comment Share on other sites More sharing options...
Roberto Nicchi Posted March 16, 2022 Share Posted March 16, 2022 1 hour ago, picyka said: function click(sender, e, eOpts) { Ext.defer(function(){ ajaxRequest(sender, '_beforeClick', []) }, 5); var textarea = document.getElementById(UniMemoResumo.JSName + '.inputId); textarea.select(); document.execCommand(''copy''); } Before copying the text of the memo, I need to feed it. Try with copy_but, JSInterface do JSAddListener('click', JSFunction('sender', 'var textarea = document.getElementById(' + unimemo1.JSName + '.inputId); ' + 'textarea.value=textarea.value.trim(); ' + 'textarea.select(); ' + 'document.execCommand(''copy'');')); Seems to work. Quote Link to comment Share on other sites More sharing options...
picyka Posted March 16, 2022 Author Share Posted March 16, 2022 36 minutes ago, Roberto Nicchi said: Try with copy_but, JSInterface do JSAddListener('click', JSFunction('sender', 'var textarea = document.getElementById(' + unimemo1.JSName + '.inputId); ' + 'textarea.value=textarea.value.trim(); ' + 'textarea.select(); ' + 'document.execCommand(''copy'');')); Seems to work. I need to set the text to the memo, before executing the click, I would like to do this in the button itself. Quote Link to comment Share on other sites More sharing options...
picyka Posted March 16, 2022 Author Share Posted March 16, 2022 I changed the screen format, you can deconcide this post. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.