Interface ClipboardOptionsIf

Copy, cut and paste like Excel (TableOptionsIf.clipboard). clipboard: true uses the defaults of ClipboardOptions; an object overrides single values.

Example

const tableOptions: TableOptionsIf = {
...new TableOptions(),
getSelectionModel: () => new SelectionModel("range", "multi"),
editing: true,
clipboard: { pasteAddsRows: true, createRow: () => ({ name: "", qty: 0 }) },
};

Since

1.1.99

Hierarchy

  • ClipboardOptionsIf

Implemented by

Properties

copyHeaders: boolean

Copy the header labels as first row. Default false.

copyValue: "raw" | "text"

"text": the text as shown (default); "raw": the value (a number without group separators, ISO dates).

createRow?: ((index) => unknown)

Type declaration

    • (index): unknown
    • Creates a new row for pasteAddsRows (the index is the display index it gets).

      Parameters

      • index: number

      Returns unknown

html: boolean

Also put an HTML <table> into the clipboard (text/html, numbers keep their value in Excel). Default true.

maxPasteCells: number

Upper limit of pasted cells (after tiling); more are refused and announced. Default 1_000_000.

pasteAddsRows: boolean

Pasting over the last row adds rows (createRow is needed for arrays of objects). Default false.

processCopy?: ((ctx) => void | string[][])

Type declaration

    • (ctx): void | string[][]
    • Changes the copied cells (return a new matrix) – or only reads them.

      Parameters

      Returns void | string[][]

processPaste?: ((ctx) => false | void | unknown[][])

Type declaration

    • (ctx): false | void | unknown[][]
    • Changes the pasted cells (return new values), refuses the paste (false) – or only reads them.

      Parameters

      Returns false | void | unknown[][]