Page 1 of 1

Copy Text to Clipboard using List Page information

Posted: Fri Apr 12, 2024 7:48 pm
by alex

Lets say I have a table and field "name" and I need to copy to clipboard a text using information from list page like "Hello, <name>...". The idea is to use the copied text for different messengers.

I am not strong in javascript so any help would be appreciated.

With no success I tried to use custom field together with "Row Rendered event" and also "ListOptions Rendered event" + "Row Custom Action event"

I read the posts below:
viewtopic.php?t=48006
viewtopic.php?t=50568

But I still cannot solve my task. Please help or advise.


Re: Copy Text to Clipboard using List Page information

Posted: Sat Apr 13, 2024 10:16 am
by arbei
  1. You should not use Custom Field as it will add an extra field unnecessarily.
  2. You should not use Row_CustomAction as it is not a custom action (which submit the row's primary key by Ajax or post back for some action),
  3. Copying to clipboard is JavaScript on the client side. Try to write your JavaScript. You may post your code for discussion. PHPMaker itself has a basic function ew.copyToClipboard(source) where source is CSS selector or HTML element.