GridCell<TData>
Defined in: js-api/src/grid.ts:474
Represents a grid cell
Type Parameters
| Type Parameter | Default type |
|---|---|
TData | any |
Constructors
Constructor
new GridCell<
TData>(dart):GridCell<TData>
Defined in: js-api/src/grid.ts:477
Parameters
| Parameter | Type |
|---|---|
dart | any |
Returns
GridCell<TData>
Properties
| Property | Type | Defined in |
|---|---|---|
dart | any | js-api/src/grid.ts:475 |
Accessors
bounds
Get Signature
get bounds():
Rect
Defined in: js-api/src/grid.ts:585
Grid cell bounds. Sample: https://public.datagrok.ai/js/samples/grid/advanced/cell-bounds
Returns
cell
Get Signature
get cell():
Cell
Defined in: js-api/src/grid.ts:562
Returns
Corresponding table cell.
cellType
Get Signature
get cellType():
string
Defined in: js-api/src/grid.ts:496
Returns
string
Cell type
Set Signature
set cellType(
x):void
Defined in: js-api/src/grid.ts:501
Allows to set cell type (needed when rendering single grid cell)
Parameters
| Parameter | Type |
|---|---|
x | string |
Returns
void
color
Get Signature
get color():
number
Defined in: js-api/src/grid.ts:580
Calculates cell background color, according to color-coding.
Returns
number
customText
Get Signature
get customText():
string
Defined in: js-api/src/grid.ts:553
Custom text to be shown in a cell .
Returns
string
Set Signature
set customText(
x):void
Defined in: js-api/src/grid.ts:554
Parameters
| Parameter | Type |
|---|---|
x | string |
Returns
void
documentBounds
Get Signature
get documentBounds():
Rect
Defined in: js-api/src/grid.ts:590
Grid cell bounds, relative to the document. Useful for showing hints, tooltips, etc.
Returns
element
Get Signature
get element():
HTMLElement
Defined in: js-api/src/grid.ts:606
Gets or sets HTML element for this grid cell.
Returns
HTMLElement
Set Signature
set element(
e):void
Defined in: js-api/src/grid.ts:607
Parameters
| Parameter | Type |
|---|---|
e | HTMLElement |
Returns
void
grid
Get Signature
get grid():
Grid
Defined in: js-api/src/grid.ts:557
Returns
this cell belongs to.
gridColumn
Get Signature
get gridColumn():
GridColumn<TData>
Defined in: js-api/src/grid.ts:545
Returns
GridColumn<TData>
Corresponding grid column.
gridRow
Get Signature
get gridRow():
number
Defined in: js-api/src/grid.ts:540
Returns
number
Index of the corresponding grid row.
isColHeader
Get Signature
get isColHeader():
boolean
Defined in: js-api/src/grid.ts:516
Returns
boolean
Whether this is a column header.
isRowHeader
Get Signature
get isRowHeader():
boolean
Defined in: js-api/src/grid.ts:511
Returns
boolean
Whether this is a row header.
isTableCell
Get Signature
get isTableCell():
boolean
Defined in: js-api/src/grid.ts:506
Returns
boolean
Whether this is a table (data) cell (as opposed to special cells like row headers).
position
Get Signature
get position():
string
Defined in: js-api/src/grid.ts:550
For debugging mostly. Returns ${this.gridColumn.name}: ${this.gridRow}.
Returns
string
renderer
Get Signature
get renderer():
GridCellRenderer
Defined in: js-api/src/grid.ts:597
Returns grid cell renderer.
Returns
style
Get Signature
get style():
GridCellStyle
Defined in: js-api/src/grid.ts:575
Returns
Style to use for rendering.
tableColumn
Get Signature
get tableColumn():
Column<TData,TData> |null
Defined in: js-api/src/grid.ts:521
Returns
Column<TData, TData> | null
Corresponding table column, or null.
tableRow
Get Signature
get tableRow():
Row|null
Defined in: js-api/src/grid.ts:526
Returns
Row | null
Corresponding table row, or null.
tableRowIndex
Get Signature
get tableRowIndex():
number|null
Defined in: js-api/src/grid.ts:531
Returns
number | null
Index of the corresponding table row.
value
Get Signature
get value():
TData
Defined in: js-api/src/grid.ts:570
Returns the value of the grid cell. Note that the value could differ from the corresponding table cell due to the following:
- setting gridCell.value inside onPrepareCell
- as a result of evaluating onPrepareValueScript
Returns
TData
Methods
render()
render(
options?):void
Defined in: js-api/src/grid.ts:601
Parameters
| Parameter | Type |
|---|---|
options? | { bounds?: Rect; context?: CanvasRenderingContext2D; } |
options.bounds? | Rect |
options.context? | CanvasRenderingContext2D |
Returns
void
setValue()
setValue(
x,notify?):void
Defined in: js-api/src/grid.ts:610
Sets the grid cell value and fires onCellValueEdited if notify is true
Parameters
| Parameter | Type | Default value |
|---|---|---|
x | any | undefined |
notify | boolean | true |
Returns
void
createColHeader()
staticcreateColHeader(gridColumn):GridCell
Defined in: js-api/src/grid.ts:491
Parameters
| Parameter | Type |
|---|---|
gridColumn | GridColumn |
Returns
GridCell
fromColumnRow()
staticfromColumnRow(grid,columnName,gridRow):GridCell
Defined in: js-api/src/grid.ts:482
Parameters
| Parameter | Type |
|---|---|
grid | Grid |
columnName | string |
gridRow | number |
Returns
GridCell
fromValue()
staticfromValue(value):GridCell
Defined in: js-api/src/grid.ts:487
Returns a synthecic GridCell that only contains value but no row/col. Useful for rendering values.
Parameters
| Parameter | Type |
|---|---|
value | any |
Returns
GridCell