new Color()
As of spring 2016: Functions well in Chrome and Firefox; unimplemented in Safari.
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:
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