Jump to content

clipboard in UnimDBGrid


picyka

Recommended Posts

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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]);
}

 

Link to comment
Share on other sites

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');  
  } 
}

 

Capturar.PNG

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...