Interface CopyCellsOptions

Options for copying cells.

interface CopyCellsOptions {
    adjustCells?: CopyCellsAdjustments | ((value, context, from, to) => ICellModel | CellUpdate);
    adjustSelection?: boolean;
    autoFit?: boolean | AutoFitOptions | HeaderOrientation;
    copySourceHeaderSize?: boolean;
    description?: string;
    fitDestination?: boolean;
    isCut?: boolean;
    noSelectOnUndo?: boolean;
    parseTextAsValue?: boolean | CellUpdateFromStringOptions;
    skipBlanks?: boolean;
    skipHeaderStyles?: boolean;
    skipMerges?: boolean;
    transpose?: boolean;
}

Hierarchy (view full)

Properties

adjustCells?: CopyCellsAdjustments | ((value, context, from, to) => ICellModel | CellUpdate)

This allows either the CopyCellsAdjustments or a callback that returns the same arguments types as CellPairs. Note

Type declaration

adjustSelection?: boolean

Default Value

true
autoFit?: boolean | AutoFitOptions | HeaderOrientation

Determines if the cells that are set should autoFit.

Default Value

true (meaning  autoFit in both directions)
copySourceHeaderSize?: boolean

The default is to only keep the source header size if it is customized or the size of the selection fits the destination

Default


description?: string

A description that is used for versioning and tracking changes.

Default Value

'determined by the consumer'
fitDestination?: boolean

When pasting from a smaller range to a larger range copy will repeat or 'wallpaper' the source values.

Note - If there is only a single cell selected and adjustSelection is true then this will still expand to fit

isCut?: boolean

If true then during copy the old values will be remove. (if possible)

Default Value

false
noSelectOnUndo?: boolean

If true then the selection will not be included in an undo operation.

Default Value

false
parseTextAsValue?: boolean | CellUpdateFromStringOptions

If this is set to true string values will try to be coerce into numbers, dates, and booleans.

Remarks

If a function is passed this will still attempt to coerce the value but will also called the function and take it's return value if not void

skipBlanks?: boolean

Note - This needs to be sorted with autoFill

Default Value

true
skipHeaderStyles?: boolean

This will skip trying to copy cells that were styled by headers. Note - If a cell has content it will still be copied. Note - This a performance hint as setting adjustCell.skipStyle will have the same result but required unnecessary processing of headers

Default Value

false
skipMerges?: boolean

If a cell is merged retain this. Note - Excel sets this to false when copy content only

Default Value

false
transpose?: boolean

Default Value

false