resolveColumnPaste
Since v3.0.0
Resolve a column’s ColumnPasteGuard (onPaste) for a single cell.
Pure — never mutates or emits. Exposed so a custom pasteHandler can honor
per-column onPaste identically to defaultPasteHandler: call it per
cell, write resolution.value when accepted, and collect the rejected cells to
pass to emitPasteRejected.
function resolveColumnPaste(onPaste: ColumnPasteGuard<unknown, unknown> | undefined, ctx: PasteCellContext): PasteResolutionParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
onPaste | ColumnPasteGuard<unknown, unknown> | undefined | The column’s onPaste config (column.onPaste), if any. |
ctx | PasteCellContext | The cell context (value, field, row, rowIndex, oldValue, sourceField). |
Example
Section titled “Example”// Inside a custom pasteHandler:const rejected: PasteRejectedCell[] = [];const res = resolveColumnPaste(column.onPaste, { value, field, row, rowIndex, oldValue });if (res.accepted) row[field] = res.value;else rejected.push({ field, rowIndex, row, value, reason: res.reason });// …after writing all cells:emitPasteRejected(grid, rejected);AI assistants: For complete API documentation, implementation guides, and code examples for this library, see https://toolboxjs.com/llms-full.txt