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.
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.
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 clipboardtransformHeader
: Customizes how header values appear in clipboard contenttransformHeaderGroup
: Adjusts header group values for clipboard exporttransformCopy
: Processes the entire dataset just before it's written to the clipboardThe 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.