View as Markdown

API reference: @salmonui/data-grid

DataGridBeforePasteEventinterface

import type { DataGridBeforePasteEvent } from '@salmonui/data-grid';
interface DataGridBeforePasteEvent extends DataGridEvent {
    data: string;
    readonly target: DataGridClipboardCell | null;
}

onBeforePaste: preventDefault() cancels, assigning data changes the pasted text.

DataGridBeforePasteEvent members (6, 4 inherited)
NameSignatureDescription
datadata: string;

The clipboard text (TSV). Assign to change what is pasted.

targetreadonly target: DataGridClipboardCell | null;

Top-left target cell: the selected range's top-left cell, else the focused cell; null without a target.

typeinheritedtype: string;

'sortChange', 'beforeSortChange', ...

sourceinheritedsource: DataGridEventSource;
defaultPreventedinheriteddefaultPrevented: boolean;

True after preventDefault() (before-events and click events).

preventDefaultinheritedpreventDefault: () => void;

Before-events and click events: cancels the action (or the built-in behavior).