SheetXL - v0.8.0-beta.9+sites.210.e2d420901
    Preparing search index...

    Interface SparseBuilder<S>

    Provides an API for efficiently performing incremental updates to specific cells within a range.

    Unless ICellRange.SparseBuilderOptions.allowUnorderedWrites is true the updates must be written in row-major or column-major order as determined by IRange.Axis, with major/minor coordinates increasing on each update, otherwise an error will be thrown.

    const builder = range.createSparseBuilder();
    builder.pushAt(1, 1, "Hello"); // as row, column, primitive - fastest
    builder.push({ rowIndex: 2, colIndex: 1 }, { value: "Beautiful" }); // as coordinate and json object
    builder.push('A3', { value: "World" }); // as a1 string and json
    builder.apply();
    interface SparseBuilder<S = ICellRange> {
        apply(options?: UpdateCellsOptions): S;
        push(address: ICell.Address, update: ICell.Update): this;
        pushAt(row: number, col: number, update: ICell.Update): this;
        pushMultipleAt(row: number, col: number, updates: ICell.Update[]): this;
    }

    Type Parameters

    • S = ICellRange

      The return type of apply, typically the source range (ICellRange).

    Index
    • Adds an update at a specific cell address.

      Parameters

      Returns this

      The current SparseBuilder instance for chaining.

      Error If the coordinates are out of order compared to previously added coordinates.

    • Adds an update at a specific major (row) and minor (column) index.

      This method is slightly faster than push as it bypasses address parsing.

      Parameters

      • row: number

        The row index of the cell to update.

      • col: number

        The column index of the cell to update.

      • update: ICell.Update

        The update to apply. See ICell.Update.

      Returns this

      The current SparseBuilder instance for chaining.

      Error If the coordinates are out of order compared to previously added coordinates.

    • Adds multiple updates for contiguous cells along the minor axis (columns), starting at the specified indices.

      Parameters

      • row: number

        The row index of the starting cell.

      • col: number

        The column index of the starting cell.

      • updates: ICell.Update[]

        An array of updates to apply to contiguous cells.

      Returns this

      The current SparseBuilder instance for chaining.

      Error If the coordinates are out of order compared to previously added coordinates.