new ErrorCell()
Extends
Methods
paint(gc, config)
Writes error message into cell.
This function is guaranteed to be called as follows:
gc.save();
gc.beginPath();
gc.rect(x, y, width, height);
gc.clip();
behavior.getCellProvider().renderCellError(gc, message, x, y, width, height);
gc.restore();
Before doing anything else, this function should clear the cell by setting gc.fillStyle
and calling gc.fill()
.
Parameters:
Name | Type | Description |
---|---|---|
gc |
CanvasRenderingContext2D | |
config |
object | |
config.bounds |
Rectangle | The clipping rect of the cell to be rendered. |
- Overrides:
roundRect(gc, x, y, width, height, radius, fill, stroke)
A simple implementation of rounding a cell.
Parameters:
Name | Type | Description |
---|---|---|
gc |
CanvasRenderingContext2D | |
x |
number | the x grid coordinate of my origin |
y |
number | the y grid coordinate of my origin |
width |
number | the width I'm allowed to draw within |
height |
number | the height I'm allowed to draw within |
radius |
number | |
fill |
number | |
stroke |
number |
- Inherited From:
Type Definitions
renderConfig
This is the renderer config object, which is:
- First passed to a
getCell
method implementation, which may override (most of) its values before returning. - Then passed to the specified cell renderers'
paint
function for rendering.
Standard Properties
On each render of every visible cell, this a fresh instance of an object created from (whose prototype is) a properties object as defined by layer-props.js. It therefore has all the standard properties defined in module:defaults
.
Additional Properties
In addition, the config object has the following additional properties.
Properties marked read-only may in fact be writable, but should be considered off limits to overriding. Do not attempt to change these properties inside a getCell
method override.
Properties marked write-only are to be defined the cell renderer for use by the caller (the grid renderer).
Type:
- object
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
config.allRowsSelected |
boolean | ||
config.bounds |
BoundingRect | Bounding rect of the cell or subcell to be rendered. |
|
config.clickRect |
object |
<optional> |
Write-only. The Cell renderer may return in this property a subrect in the cell's local coordinates that represents a click region. If defined by the cell renderer, the CellClick feature will ignore clicks outside the click region. If not defined by the cell renderer, the entire cell is clickable. |
config.dataCell |
dataCellCoords | Read-only. Data coordinates of the cell. |
|
config.dataRow |
dataRowObject | Access to other column values in the same row. |
|
config.formatValue |
function | For cell renderer use only. Not available in |
|
config.gridCell |
gridCellCoords | Read-only. Grid coordinates of the cell. |
|
config.halign |
string | The cell's horizontal alignment property, as interpreted by it's cell renderer. |
|
config.isCellHovered |
boolean | - |
|
config.isCellSelected |
boolean | - |
|
config.isColumnHovered |
boolean | - |
|
config.isColumnSelected |
boolean | - |
|
config.isDataColumn |
boolean | - |
|
config.isDataRow |
boolean | - |
|
config.isFilterRow |
boolean | - |
|
config.isHandleColumn |
boolean | - |
|
config.isHeaderRow |
boolean | - |
|
config.isInCurrentSelectionRectangle |
boolean | - |
|
config.isRowHovered |
boolean | - |
|
config.isRowSelected |
boolean | - |
|
config.isSelected |
boolean | - |
|
config.isTreeColumn |
boolean | - |
|
config.isUserDataArea |
boolean | - |
|
config.minWidth |
number | Write-only. The Cell renderer should return the pixel width of the rendered contents in this property. |
|
config.mouseDown |
boolean | The last mousedown event occurred over this cell and the mouse is still down. Note, however, that the mouse may no longer be hovering over this cell when it has been dragged away. |
|
config.prefillColor |
<optional> |
Write-only. This is the color already painted by the grid renderer behind the cell to be rendered. If the cell's specified background color is the same, renderer may (and should!) skip painting it. If |
|
config.snapshot |
object |
<optional> |
Write-only. Supports partial render. In support of the |
config.value |
Value to be rendered. The renderer has available to it the Typically a Local primitive value, values can be any type, including objects and arrays. The specified cell renderer is expected to know how to determine the value's type and render it. |
- Inherited From: