Export

Clipboard

LyteNyte Grid offers three API methods for copying, cutting, and pasting data between the grid and clipboard. Each method provides options to transform data before executing the action. A full example is shown below. The following sections cover other parts of the clipboard API.

Clipboard Copy and Cut

Copy and Cut

The clipboardCopyCells and clipboardCutCells API methods allow you to copy or cut cells from LyteNyte Grid. Note that cutting cells requires a row data source that supports data updates.

Copy and Cut Options

Both clipboardCopyCells and clipboardCutCells accept options as a second parameter to customize clipboard operations.

By default, copying cells excludes column headers and group headers. To include these elements, set the includeHeaders and includeHeaderGroups properties to true.

When you need to modify how values are copied, several transform hooks are available. LyteNyte Grid uses these callbacks to process data before writing to the clipboard:

  • transformCellValue: Modifies individual cell values before they're written to the clipboard.
  • transformHeader: Customizes how header values appear in clipboard content.
  • transformHeaderGroup: Adjusts header group values for clipboard export.
  • transformCopy: Processes the entire dataset just before it's written to the clipboard.

Paste Cells

The clipboardPasteCells API method enables pasting clipboard data into the grid. The expected format is space-separated columns with new lines separating rows. For data in different formats, you can provide a transformPaste callback through the clipboard paste options parameter.