picyka Posted February 18, 2022 Share Posted February 18, 2022 I would like to click on the column with image to copy the contents of a field to the clipboard. It seems that it has a delay, it always copies the previous one. And on cell phone that way doesn't work Note: the Attachment is from another post, I just made an adaptation ___TEST___.rar Quote Link to comment Share on other sites More sharing options...
picyka Posted February 18, 2022 Author Share Posted February 18, 2022 My project here, I still use an image, so sometimes I click on the image and it doesn't synchronize the line with the record in the dataset. I already had a problem here http://forums.unigui.com/index.php?/topic/1149-cell-grid-position/&tab=comments#comment-100577 Quote Link to comment Share on other sites More sharing options...
picyka Posted February 22, 2022 Author Share Posted February 22, 2022 function childsingletap(sender, location, eOpts) { var me= this; Ext.defer(function() {ajaxRequest(me, '_cellclick', ['colIndx=' + location.columnIndex]);}, 200); } I tried this format, it doesn't work either, it seems that I need to click twice to get the copy right. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 22, 2022 Share Posted February 22, 2022 On 2/18/2022 at 9:44 PM, picyka said: ___TEST___.rar 1.6 MB · 0 downloads Is this a test case? Quote Link to comment Share on other sites More sharing options...
picyka Posted February 22, 2022 Author Share Posted February 22, 2022 Just now, Sherzod said: Is this a test case? yes, I'm here trying to find a solution, what I can see is that I'm struggling to selectAll in unimmemo Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 22, 2022 Share Posted February 22, 2022 1 minute ago, picyka said: what I can see is that I'm struggling to selectAll in unimmemo Hmm, what do you mean? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 22, 2022 Share Posted February 22, 2022 I don't have VirtualTable. Quote Link to comment Share on other sites More sharing options...
picyka Posted February 22, 2022 Author Share Posted February 22, 2022 procedure TUniFrameViewBoleto.ADBoletosAfterScroll(DataSet: TDataSet); begin Self.UnimMemoCopy.Text := Self.ADBoletos.Current<TBoletoDTO>.LinhaDigitavel; inherited; end; if (Params.Values['colIndx'] = '1') then begin UniSession.JSCode('var textarea = document.getElementById('+ UnimMemoCopy.JSName+'.inputElement.id); '+ 'textarea.focus(); ' + 'textarea.select();'); UniSession.JSCode('document.execCommand(''copy'', true, textarea.value);'); TToastUtils.ShowMessageToast('Linha digitável copiado com sucesso!', tpSucess); end; That way it worked, sometimes I feel like I have to do wrong to make it right.. it looks like select(); does not work the first time on unimemo Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 22, 2022 Share Posted February 22, 2022 It's better to do it directly on the client side. Quote Link to comment Share on other sites More sharing options...
picyka Posted February 22, 2022 Author Share Posted February 22, 2022 5 minutos atrás, Sherzod disse: É melhor fazê-lo diretamente do lado do cliente. I went to tell victory before the time I got sick, on the phone it doesn't work hahahahaha Quote Link to comment Share on other sites More sharing options...
picyka Posted February 22, 2022 Author Share Posted February 22, 2022 function tap(sender, e, eOpts) { UniFrameCadAtendVeiculoM.UnimMemoResumo.focus(true); UniFrameCadAtendVeiculoM.UnimMemoResumo.select(); document.execCommand('copy'); } I have this in another project, clicking on a unimbutton works, this one is different, it's clicking on an image of a unimdbgrid function childsingletap(sender, location, eOpts) { ajaxRequest(sender, '_cellclick', ["colIndx="+location.columnIndex]); } Quote Link to comment Share on other sites More sharing options...
picyka Posted February 22, 2022 Author Share Posted February 22, 2022 function childsingletap(sender, location, eOpts) { if location == 1 { UniFrameViewBoleto.UnimMemoCopy.focus(true); UniFrameViewBoleto.UnimMemoCopy.select(); document.execCommand('copy'); } } so there was an error when opening the screen... Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 22, 2022 Share Posted February 22, 2022 1 minute ago, picyka said: if location == 1 Incorrect. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 22, 2022 Share Posted February 22, 2022 if (location == xx) { } Quote Link to comment Share on other sites More sharing options...
picyka Posted February 22, 2022 Author Share Posted February 22, 2022 function childsingletap(sender, location, eOpts) { if location.columnIndex == 1 { UniFrameViewBoleto.UnimMemoCopy.focus(true); UniFrameViewBoleto.UnimMemoCopy.select(); document.execCommand('copy'); } } yes i saw it but it still gives error Quote Link to comment Share on other sites More sharing options...
picyka Posted February 22, 2022 Author Share Posted February 22, 2022 I'm using class(TUniFrame) How do I get the memo there? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 22, 2022 Share Posted February 22, 2022 6 minutes ago, picyka said: if location.columnIndex == 1 Incorrect! Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 22, 2022 Share Posted February 22, 2022 if (location.columnIndex == 1) Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 22, 2022 Share Posted February 22, 2022 https://www.w3schools.com/js/js_if_else.asp Quote Link to comment Share on other sites More sharing options...
picyka Posted February 22, 2022 Author Share Posted February 22, 2022 function childsingletap(sender, location, eOpts) { if (location.columnIndex == 1) { MainmForm.UniFrameViewBoleto.UnimMemoCopy.focus(true); MainmForm.UniFrameViewBoleto.UnimMemoCopy.select(); document.execCommand('copy'); } } Quote Link to comment Share on other sites More sharing options...
picyka Posted February 22, 2022 Author Share Posted February 22, 2022 I'm not able to get the memo that is on top of a uniframe Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 22, 2022 Share Posted February 22, 2022 1 minute ago, picyka said: UniFrameViewBoleto Is it a frame? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 22, 2022 Share Posted February 22, 2022 Just now, Sherzod said: Is it a frame? If yes, use without MainmForm. Quote Link to comment Share on other sites More sharing options...
picyka Posted February 22, 2022 Author Share Posted February 22, 2022 3 minutes ago, Sherzod said: Se sim, use sem MainmForm. yes function childsingletap(sender, location, eOpts) { if (location.columnIndex == 1) { MainmForm.UnimMemoCopy.focus(true); MainmForm.UnimMemoCopy.select(); document.execCommand('copy'); } } Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 22, 2022 Share Posted February 22, 2022 MainmForm.UniFrameViewBoleto.UnimMemoCopy UniFrameViewBoleto.UnimMemoCopy 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.