CellRange Class
File
wijmo.grid.js
Module
wijmo.grid

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

Constructor

constructor

constructor(r?: number, c?: number, r2?: number, c2?: number): CellRange

Initializes a new instance of the CellRange class.

Parameters
  • r: number Optional

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

  • c: number Optional

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

  • r2: number Optional

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

  • c2: number Optional

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

Returns
CellRange

Properties

bottomRow

Gets the index of the bottom row in this range.

Type
number

col

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

Type
number

col2

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

Type
number

columnSpan

Gets the number of columns in this range.

Type
number

isSingleCell

Checks whether this range corresponds to a single cell.

Type
boolean

isValid

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

Type
boolean

leftCol

Gets the index of the leftmost column in this range.

Type
number

rightCol

Gets the index of the rightmost column in this range.

Type
number

row

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

Type
number

row2

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

Type
number

rowSpan

Gets the number of rows in this range.

Type
number

topRow

Gets the index of the top row in this range.

Type
number

Methods

clone

clone(): CellRange

Creates a copy of this range.

Returns
CellRange

combine

combine(rng: CellRange): CellRange

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

Parameters
Returns
CellRange

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.

  • c: number Optional

    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

copy(rng: CellRange): void

Copies an existing cell range into this one.

Parameters
Returns
void

equals

equals(rng: CellRange): boolean

Checks whether this range equals another range.

Parameters
Returns
boolean

getRenderSize

getRenderSize(p: GridPanel): Size

Gets the rendered size of this range.

Parameters
Returns
Size

intersects

intersects(rng: CellRange): boolean

Checks whether this range intersects another range.

Parameters
Returns
boolean

intersectsColumn

intersectsColumn(rng: CellRange): boolean

Checks whether this range intersects the columns in another range.

Parameters
Returns
boolean

intersectsRow

intersectsRow(rng: CellRange): boolean

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
  • r: number Optional

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

  • c: number Optional

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

  • r2: number Optional

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

  • c2: number Optional

    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