GridCell<TData>
Represents a grid cell
Type parameters
| Type parameter | Value |
|---|---|
TData | any |
Constructors
new GridCell()
new GridCell<
TData>(dart):GridCell<TData>
Parameters
| Parameter | Type |
|---|---|
dart | any |
Returns
GridCell<TData>
Source
Properties
| Property | Type |
|---|---|
dart | any |
Accessors
bounds
getbounds():Rect
Grid cell bounds. Sample: https://public.datagrok.ai/js/samples/grid/cell-bounds
Returns
Source
cell
getcell():Cell
Returns
Corresponding table cell.
Source
cellType
getcellType():string
setcellType(x):void
Allows to set cell type (needed when rendering single grid cell)
Parameters
| Parameter | Type |
|---|---|
x | string |
Returns
string
Cell type
Source
color
getcolor():number
Calculates cell background color, according to color-coding.
Returns
number
Source
customText
getcustomText():string
Custom text to be shown in a cell .
setcustomText(x):void
Parameters
| Parameter | Type |
|---|---|
x | string |
Returns
string
Source
documentBounds
getdocumentBounds():Rect
Grid cell bounds, relative to the document. Useful for showing hints, tooltips, etc.
Returns
Source
element
getelement():HTMLElement
Gets or sets HTML element for this grid cell.
setelement(e):void
Parameters
| Parameter | Type |
|---|---|
e | HTMLElement |
Returns
HTMLElement
Source
grid
getgrid():Grid
Returns
this cell belongs to.
Source
gridColumn
getgridColumn():GridColumn<TData>
Returns
GridColumn<TData>
Corresponding grid column.
Source
gridRow
getgridRow():number
Returns
number
Index of the corresponding grid row.
Source
isColHeader
getisColHeader():boolean
Returns
boolean
Whether this is a column header.
Source
isRowHeader
getisRowHeader():boolean
Returns
boolean
Whether this is a row header.
Source
isTableCell
getisTableCell():boolean
Returns
boolean
Whether this is a table (data) cell (as opposed to special cells like row headers).
Source
position
getposition():string
For debugging mostly. Returns ${this.gridColumn.name}: ${this.gridRow}.
Returns
string
Source
renderer
getrenderer():GridCellRenderer<any>
Returns grid cell renderer.
Returns
GridCellRenderer<any>
Source
style
getstyle():GridCellStyle
Returns
Style to use for rendering.
Source
tableColumn
gettableColumn():null|Column<TData,TData>
Returns
null | Column<TData, TData>
Corresponding table column, or null.
Source
tableRow
gettableRow():null|Row
Returns
null | Row
Corresponding table row, or null.
Source
tableRowIndex
gettableRowIndex():null|number
Returns
null | number
Index of the corresponding table row.
Source
value
getvalue():TData
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
Source
Methods
render()
render(
options?):void
Parameters
| Parameter | Type |
|---|---|
options? | object |
options.bounds? | Rect |
options.context? | CanvasRenderingContext2D |
Returns
void
Source
setValue()
setValue(
x,notify):void
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
Source
createColHeader()
staticcreateColHeader(gridColumn):GridCell<any>
Parameters
| Parameter | Type |
|---|---|
gridColumn | GridColumn<any> |
Returns
GridCell<any>
Source
fromColumnRow()
staticfromColumnRow(grid,columnName,gridRow):GridCell<any>
Parameters
| Parameter | Type |
|---|---|
grid | Grid |
columnName | string |
gridRow | number |
Returns
GridCell<any>
Source
fromValue()
staticfromValue(value):GridCell<any>
Returns a synthecic GridCell that only contains value but no row/col. Useful for rendering values.
Parameters
| Parameter | Type |
|---|---|
value | any |
Returns
GridCell<any>