Class: GridCell
dg.GridCell
Represents a grid cell
Constructors
constructor
• new GridCell(dart
)
Parameters
Name | Type |
---|---|
dart | any |
Defined in
Properties
dart
• dart: any
Defined in
Accessors
bounds
• get
bounds(): Rect
Grid cell bounds. Sample: https://public.datagrok.ai/js/samples/grid/cell-bounds
Returns
Defined in
cell
• get
cell(): Cell
Returns
Corresponding table cell.
Defined in
cellType
• get
cellType(): string
Returns
string
Cell type
Defined in
color
• get
color(): number
Calculates cell background color, according to color-coding.
Returns
number
Defined in
customText
• get
customText(): string
Custom text to be shown in a cell .
Returns
string
Defined in
• set
customText(x
): void
Parameters
Name | Type |
---|---|
x | string |
Returns
void
Defined in
documentBounds
• get
documentBounds(): Rect
Grid cell bounds, relative to the document. Useful for showing hints, tooltips, etc.
Returns
Defined in
element
• get
element(): HTMLElement
Gets or sets HTML element for this grid cell.
Returns
HTMLElement
Defined in
• set
element(e
): void
Parameters
Name | Type |
---|---|
e | HTMLElement |
Returns
void
Defined in
grid
• get
grid(): Grid
Returns
this cell belongs to.
Defined in
gridColumn
• get
gridColumn(): GridColumn
Returns
Corresponding grid column.
Defined in
gridRow
• get
gridRow(): number
Returns
number
Index of the corresponding grid row.
Defined in
isColHeader
• get
isColHeader(): boolean
Returns
boolean
Whether this is a column header.
Defined in
isRowHeader
• get
isRowHeader(): boolean
Returns
boolean
Whether this is a row header.
Defined in
isTableCell
• get
isTableCell(): boolean
Returns
boolean
Whether this is a table (data) cell (as opposed to special cells like row headers).
Defined in
renderer
• get
renderer(): GridCellRenderer
Returns grid cell renderer.
Returns
Defined in
style
• get
style(): GridCellStyle
Returns
Style to use for rendering.
Defined in
tableColumn
• get
tableColumn(): null
| Column
<any
>
Returns
null
| Column
<any
>
Corresponding table column, or null.
Defined in
tableRow
• get
tableRow(): null
| Row
Returns
null
| Row
Corresponding table row, or null.
Defined in
tableRowIndex
• get
tableRowIndex(): null
| number
Returns
null
| number
Index of the corresponding table row.
Defined in
Methods
setValue
▸ setValue(x
, notify?
): void
Sets the grid cell value and fires onCellValueEdited if notify is true
Parameters
Name | Type | Default value |
---|---|---|
x | any | undefined |
notify | boolean | true |
Returns
void
Defined in
fromColumnRow
▸ Static
fromColumnRow(grid
, columnName
, gridRow
): GridCell
Parameters
Name | Type |
---|---|
grid | Grid |
columnName | string |
gridRow | number |
Returns
Defined in
fromValue
▸ Static
fromValue(value
): GridCell
Returns a synthecic GridCell that only contains value but no row/col. Useful for rendering values.
Parameters
Name | Type |
---|---|
value | any |