Copy controls

From CTRNet Wiki
Jump to: navigation, search

The copy controls field is used in a gridview display to allow user to easily copy/paste lines.

How to implement

Adding the copy controls to your gridview involves three simple steps.

  1. First, you need to add the copy controls field to your structure. As of this writing, to copy control field id is 235 and its old id is CAN-999-999-000-999-1119.
  2. Before including the copy control script, you need to provide it with linguistics translations. You can simply copy the following code.

  3. <script type="text/javascript">
    var copyStr = "<?php echo(__("copy", null)); ?>";
    var pasteStr = "<?php echo(__("paste")); ?>";
    var copyingStr = "<?php echo(__("copying")); ?>";
    </script>
    
  4. Then, you need to include the copyControl script into your view by adding the following line
  5. echo $javascript->link('copyControl')."\n";.
    
Personal tools