new Slider()
Extends
Members
checkEditorPositionFlag :boolean
if true, check that the editor is in the right location
Type:
- boolean
- Inherited From:
- Default Value:
- false
selectAll
select everything
- Inherited From:
Methods
checkEditor()
check that the editor is in the correct location, and is showing/hidden appropriately
- Inherited From:
errorEffectBegin(erroropt)
Calls the effect function indicated in the feedbackEffect
property, which triggers a series of CSS transitions.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
error |
boolean | string | Error |
<optional> |
If defined, call the |
- Inherited From:
getEditorValue(str) → {object}
Extract the edited value from the editor.
De-format the edited string back into a primitive value.
The localizer's parse
method will be called on the text box contents.
Override this method if your editor has additional or alternative GUI elements. The GUI elements will influence the primitive value, either by altering the edited string before it is parsed, or by transforming the parsed value before returning it.
Parameters:
Name | Type | Description |
---|---|---|
str |
string | current editors input string |
- Inherited From:
Throws:
-
Throws an error on parse failure. If the error's
message
is defined, the message will eventually be displayed (everyfeedbackCount
th attempt). - Type
- boolean | string | Error
Returns:
the current editor's value
- Type
- object
gridRenderedNotification()
This function is a callback from the fin-hypergrid. It is called after each paint of the canvas.
- Inherited From:
hideEditor()
hide the editor
- Inherited From:
moveEditor()
move the editor to the current editor point
- Inherited From:
paint()
Emerson's paint function for a slider button. currently the user cannot interact with it
- 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:
saveEditorValue() → {boolean}
save the new value into the behavior (model)
- Inherited From:
Returns:
Data changed and pre-cell-edit event was not canceled.
- Type
- boolean
scrollValueChangedNotification()
scroll values have changed, we've been notified
- Inherited From:
setBounds(rectangle)
set the bounds of my input control
Parameters:
Name | Type | Description |
---|---|---|
rectangle |
rectangle | the bounds to move to |
- Inherited From:
setEditorValue(value)
Put the value into our editor.
Formats the value and displays it.
The localizer's format
method will be called.
Override this method if your editor has additional or alternative GUI elements.
Parameters:
Name | Type | Description |
---|---|---|
value |
object | The raw unformatted value from the data source that we want to edit. |
- Inherited From:
showEditor()
display the editor
- Inherited From:
stopEditing(feedbackopt) → {boolean}
Stops editing.
Before saving, validates the edited value in two phases as follows:
- Call
validateEditorValue
. (Calls the localizer'sinvalid()
function, if available.) - Catch any errors thrown by the
getEditorValue
method.
If the edited value passes both phases of the validation:
Saves the edited value by calling the saveEditorValue
method.
On validation failure:
- If
feedback
was omitted, cancels editing, discarding the edited value. - If
feedback
was provided, gives the user some feedback (seefeedback
, below).
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
feedback |
number |
<optional> |
What to do on validation failure. One of:
|
- Inherited From:
Returns:
Truthy means successful stop. Falsy means syntax error prevented stop. Note that editing is canceled when no feedback requested and successful stop includes (successful) cancel.
- Type
- boolean
takeFocus()
Request focus for my input control.
See GRID-95 "Scrollbar moves inward" for issue and work-around explanation.
- Inherited From:
validateEditorValue(str) → {boolean|string}
If there is no validator on the localizer, returns falsy (not invalid; possibly valid).
Parameters:
Name | Type | Description |
---|---|---|
str |
string | current editors input string |
- Inherited From:
Throws:
-
May throw an error on syntax failure as an alternative to returning truthy. Define the error's
message
field as an alternative to returning string. - Type
- boolean | string | Error
Returns:
Truthy value means invalid. If a string, this will be an error message. If not a string, it merely indicates a generic invalid result.
- Type
- boolean | string
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: