View as Markdown

API reference: @salmonui/data-grid

DataGridClipboardApiinterface

import type { DataGridClipboardApi } from '@salmonui/data-grid';
interface DataGridClipboardApi {
    copy(options?: DataGridCopyOptions): CommandResult;
    paste(text?: string): CommandResult;
}

Clipboard methods of the DataGrid instance. Need editing (it registers the clipboard module).

DataGridClipboardApi members (2)
NameSignatureDescription
copycopy(options?: DataGridCopyOptions): CommandResult;

Copies the cell range, else the selected rows, else the focused cell to the system clipboard (drafts included). Falls back to a copy dialog when the browser blocks clipboard access. rejected with nothingToCopy or cancelled (onBeforeCopy).

pastepaste(text?: string): CommandResult;

Pastes TSV text at the selected range or focused cell. Without text, reads the system clipboard (async), or opens a paste dialog when the Clipboard API is unavailable.