Class: Date

Date

new Date()

As of spring 2016: Functions well in Chrome except no localization (day, month names; date format). Unimplemented in Safari, Firefox, Internet Explorer. This is a "snmart" control. It detects Chrome:

  • If Chrome, uses chromeDate overrides format to that required by the value attribute, yyyy-mm-dd. (Note that this is not the format displayed in the control, which is always mm/dd/yyyy.)
  • Otherwise uses localized date format but falls back to a regular text box.

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 errorEffectEnd method at the end of the last effect transition with this error.

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 (every feedbackCountth 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:

  1. Call validateEditorValue. (Calls the localizer's invalid() function, if available.)
  2. 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:

  1. If feedback was omitted, cancels editing, discarding the edited value.
  2. If feedback was provided, gives the user some feedback (see feedback, below).
Parameters:
Name Type Attributes Description
feedback number <optional>

What to do on validation failure. One of:

  • undefined - Do not show the error effect or the end effect. Just discard the value and close the editor (as if ESC had been typed).
  • 0 - Just shows the error effect (see the errorEffect property).
  • 1 - Shows the error feedback effect followed by the detailed explanation.
  • 2 or more:
    1. Shows the error feedback effect
    2. On every feedback tries, shows the detailed explanation.
  • If undefined (omitted), simply cancels editing without saving edited value.
  • If 0, shows the error feedback effect (see the errorEffect property).
  • If > 0, shows the error feedback effect and calls the errorEffectEnd method) every feedback call(s) to stopEditing.
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