API reference: @salmonui/data-grid
DataGridBeforeCopyEventinterface
import type { DataGridBeforeCopyEvent } from '@salmonui/data-grid';interface DataGridBeforeCopyEvent extends DataGridEvent {
data: string;
readonly includeHeaders: boolean;
readonly copied: 'range' | 'rows' | 'cell';
readonly cells: number;
readonly rowIds: readonly RowId[];
readonly fields: readonly string[];
}
onBeforeCopy: preventDefault() cancels, assigning data replaces the text.
| Name | Signature | Description |
|---|---|---|
data | data: string; | The TSV text about to be written to the clipboard. Assign to replace it. |
includeHeaders | readonly includeHeaders: boolean; | |
copied | readonly copied: 'range' | 'rows' | 'cell'; | What was copied: the cell range, the selected rows, or the focused cell. |
cells | readonly cells: number; | Copied data cells (headers excluded). |
rowIds | readonly rowIds: readonly RowId[]; | |
fields | readonly fields: readonly string[]; | |
typeinherited | type: string; |
|
sourceinherited | source: DataGridEventSource; | |
defaultPreventedinherited | defaultPrevented: boolean; | True after |
preventDefaultinherited | preventDefault: () => void; | Before-events and click events: cancels the action (or the built-in behavior). |