[]
        
(Showing Draft Content)

CellRange Class

CellRange Class

Represents a rectangular group of cells defined by two row indices and two column indices.

Heirarchy

  • CellRange

Constructors

constructor

  • new CellRange(r?: number, c?: number, r2?: number, c2?: number): CellRange
  • Initializes a new instance of the CellRange class.

    Parameters

    • Optional r: number

      The index of the first row in the range (defaults to -1).

    • Optional c: number

      The index of the first column in the range (defaults to -1).

    • Optional r2: number

      The index of the last row in the range (defaults to r).

    • Optional c2: number

      The index of the last column in the range (defaults to c).

    Returns CellRange

Properties

bottomRow

bottomRow: number

Gets the index of the bottom row in this range.

col

col: number

Gets or sets the index of the first column in this range.

col2

col2: number

Gets or sets the index of the second column in this range.

columnSpan

columnSpan: number

Gets the number of columns in this range.

isSingleCell

isSingleCell: boolean

Checks whether this range corresponds to a single cell.

isValid

isValid: boolean

Checks whether this range contains valid row and column indices (row and column values are zero or greater).

leftCol

leftCol: number

Gets the index of the leftmost column in this range.

rightCol

rightCol: number

Gets the index of the rightmost column in this range.

row

row: number

Gets or sets the index of the first row in this range.

row2

row2: number

Gets or sets the index of the second row in this range.

rowSpan

rowSpan: number

Gets the number of rows in this range.

topRow

topRow: number

Gets the index of the top row in this range.

Methods

clone

  • Creates a copy of this range.

    Returns CellRange

combine

  • Returns a new CellRange that represents the union of this range and another given range.

    Parameters

    Returns CellRange

    A CellRange object that represents the union of this range and the given range, or this range if the range to combine with is null.

contains

  • contains(r: any, c?: number): boolean
  • Checks whether this range contains another range or a specific cell.

    Parameters

    • r: any

      The CellRange or row index to find.

    • Optional c: number

      The column index (required if the r parameter is not a CellRange object).

    Returns boolean

containsColumn

  • containsColumn(c: number): boolean
  • Checks whether this range contains a given column.

    Parameters

    • c: number

      The index of the column to find.

    Returns boolean

containsRow

  • containsRow(r: number): boolean
  • Checks whether this range contains a given row.

    Parameters

    • r: number

      The index of the row to find.

    Returns boolean

copy

  • Copies an existing cell range into this one.

    Parameters

    Returns void

equals

  • Checks whether this range equals another range.

    Parameters

    Returns boolean

getRenderSize

  • Gets the rendered size of this range.

    Parameters

    Returns Size

    A Size object that represents the sum of row heights and column widths in this range.

intersects

  • Checks whether this range intersects another range.

    Parameters

    Returns boolean

intersectsColumn

  • Checks whether this range intersects the columns in another range.

    Parameters

    Returns boolean

intersectsRow

  • Checks whether this range intersects the rows in another range.

    Parameters

    Returns boolean

setRange

  • setRange(r?: number, c?: number, r2?: number, c2?: number): void
  • Initializes an existing CellRange.

    Parameters

    • Optional r: number

      The index of the first row in the range (defaults to -1).

    • Optional c: number

      The index of the first column in the range (defaults to -1).

    • Optional r2: number

      The index of the last row in the range (defaults to r).

    • Optional c2: number

      The index of the last column in the range (defaults to c).

    Returns void

toString

  • toString(): string
  • Returns a string representing this CellRange.

    Returns string