Skip to main content

GridCell

Represents a grid cell

Constructors

new GridCell()

new GridCell(dart): GridCell

Parameters

ParameterType
dartany

Returns

GridCell

Source

src/grid.ts:489

Properties

PropertyType
dartany

Accessors

bounds

get bounds(): Rect

Grid cell bounds. Sample: https://public.datagrok.ai/js/samples/grid/cell-bounds

Returns

Rect

Source

src/grid.ts:573


cell

get cell(): Cell

Returns

Cell

Corresponding table cell.

Source

src/grid.ts:558


cellType

get cellType(): string

Returns

string

Cell type

Source

src/grid.ts:504


color

get color(): number

Calculates cell background color, according to color-coding.

Returns

number

Source

src/grid.ts:568


customText

get customText(): string

Custom text to be shown in a cell .

set customText(x): void

Parameters

ParameterType
xstring

Returns

string

Source

src/grid.ts:549


documentBounds

get documentBounds(): Rect

Grid cell bounds, relative to the document. Useful for showing hints, tooltips, etc.

Returns

Rect

Source

src/grid.ts:578


element

get element(): HTMLElement

Gets or sets HTML element for this grid cell.

set element(e): void

Parameters

ParameterType
eHTMLElement

Returns

HTMLElement

Source

src/grid.ts:590


grid

get grid(): Grid

Returns

Grid

this cell belongs to.

Source

src/grid.ts:553


gridColumn

get gridColumn(): GridColumn

Returns

GridColumn

Corresponding grid column.

Source

src/grid.ts:544


gridRow

get gridRow(): number

Returns

number

Index of the corresponding grid row.

Source

src/grid.ts:539


isColHeader

get isColHeader(): boolean

Returns

boolean

Whether this is a column header.

Source

src/grid.ts:519


isRowHeader

get isRowHeader(): boolean

Returns

boolean

Whether this is a row header.

Source

src/grid.ts:514


isTableCell

get isTableCell(): boolean

Returns

boolean

Whether this is a table (data) cell (as opposed to special cells like row headers).

Source

src/grid.ts:509


renderer

get renderer(): GridCellRenderer

Returns grid cell renderer.

Returns

GridCellRenderer

Source

src/grid.ts:585


style

get style(): GridCellStyle

Returns

GridCellStyle

Style to use for rendering.

Source

src/grid.ts:563


tableColumn

get tableColumn(): null | Column<any>

Returns

null | Column<any>

Corresponding table column, or null.

Source

src/grid.ts:524


tableRow

get tableRow(): null | Row

Returns

null | Row

Corresponding table row, or null.

Source

src/grid.ts:529


tableRowIndex

get tableRowIndex(): null | number

Returns

null | number

Index of the corresponding table row.

Source

src/grid.ts:534

Methods

setValue()

setValue(x, notify): void

Sets the grid cell value and fires onCellValueEdited if notify is true

Parameters

ParameterTypeDefault value
xanyundefined
notifybooleantrue

Returns

void

Source

src/grid.ts:594


fromColumnRow()

static fromColumnRow(grid, columnName, gridRow): GridCell

Parameters

ParameterType
gridGrid
columnNamestring
gridRownumber

Returns

GridCell

Source

src/grid.ts:494


fromValue()

static fromValue(value): GridCell

Returns a synthecic GridCell that only contains value but no row/col. Useful for rendering values.

Parameters

ParameterType
valueany

Returns

GridCell

Source

src/grid.ts:499