v5.20192.624
|

CellRange Class

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

Hierarchy

  • 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 the range.

col

col: number

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

col2

col2: number

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

columnSpan

columnSpan: number

Gets the number of columns in the range.

isSingleCell

isSingleCell: boolean

Checks whether this range corresponds to a single cell (beginning and ending rows have the same index, and beginning and ending columns have the same index).

isValid

isValid: boolean

Checks whether the 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 the range.

rightCol

rightCol: number

Gets the index of the rightmost column in the range.

row

row: number

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

row2

row2: number

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

rowSpan

rowSpan: number

Gets the number of rows in the range.

topRow

topRow: number

Gets the index of the top row in the range.

Methods

clone

  • Creates a copy of the range.

    Returns CellRange

contains

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

    Parameters

    • r: any

      The CellRange object 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 the range contains a given column.

    Parameters

    • c: number

      The index of the column to find.

    Returns boolean

containsRow

  • containsRow(r: number): boolean
  • Checks whether the 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 the range equals another range.

    Parameters

    • rng: CellRange

      The CellRange object to compare to this range.

    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 the range.

intersects

  • Checks whether the range intersects another range.

    Parameters

    • rng: CellRange

      The CellRange object to check.

    Returns boolean

intersectsColumn

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

    Parameters

    • rng: CellRange

      The CellRange object to check.

    Returns boolean

intersectsRow

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

    Parameters

    • rng: CellRange

      The CellRange object to check.

    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