Skip to content

CopyOptions

Options for programmatic copy operations.

Allows callers to control exactly which columns and rows are included in a copy, independently of the current selection state.

const clipboard = grid.getPluginByName('clipboard');
// User selected rows 0, 2, 4 via a dialog, chose columns to include
const text = await clipboard.copy({
rowIndices: [0, 2, 4],
columns: ['name', 'email'],
includeHeaders: true,
});
PropertyTypeDescription
columns?string[]Specific column fields to include. If omitted, uses current selection or all visible columns.
rowIndices?number[]Specific row indices to copy. If omitted, uses current selection or all rows.
includeHeaders?booleanInclude column headers in copied text. Defaults to the plugin config value.
delimiter?stringColumn delimiter override. Defaults to the plugin config value.
newline?stringRow delimiter override. Defaults to the plugin config value.
processCell?(value: unknown, field: string, row: unknown) => stringCustom cell value processor for this operation. Overrides the plugin config’s processCell.
AI assistants: For complete API documentation, implementation guides, and code examples for this library, see https://raw.githubusercontent.com/OysteinAmundsen/toolbox/main/llms-full.txt