NavigatorBox.copy

Syntax

copy();

Description

The copy method adds a copy of selected objects to the clipboard without changing original objects.

Comments

This method starts executing on clicking the Copy button in the Home ribbon tab.

Example

To execute the example, the page must contain NavigatorBox component named navbox (see Example of Creating the NavigatorBox Component). Add context menu for objects in the list:

          navbox.ObjectListContextMenu.add(function (sender, args)
          {
             cm.showContext(args.Event.pageX, args.Event.pageY)
          });
           var cm = new PP.Ui.Menu(
          {
             Items: [
             {
                MenuItem: {
                   Content: "Copy",
                   Id: "copy"
                }
             },
             {
                MenuItem: {
                   Content: "Cut",
                   Id: "cut"
                }
             },
             {
                MenuItem: {
                   Content: "Paste",
                   Id: "paste"
                }
             },
             {
                MenuItem: {
                   Content: "Delete",
                   Id: "delete"
                }
             }, ]
          });
           cm.getMenuItemById("copy").Click.add(function (sender, args)
          {
             navbox.copy()
          });
          cm.getMenuItemById("cut").Click.add(function (sender, args)
          {
             navbox.cut()
          });
          cm.getMenuItemById("paste").Click.add(function (sender, args)
          {
             navbox.paste()
          });
          cm.getMenuItemById("delete").Click.add(function (sender, args)
          {
             navbox.deleteObjects()
          });

After executing the example the following context menu appears for the list objects:

On selecting a context menu item, appropriate operation is performed on the object: copy, cut, paste, or delete.

See also:

NavigatorBox