Class: AvatarEditorView

module:core.form.editors. AvatarEditorView

Editor used to set (or unset) an image to be used mainly as user avatar and process it any way (e.g. upload to server).

new AvatarEditorView()

Parameters:
Name Type Description
options.fullName string Full name used to fill editor with initials when no value is provided.
options.removable boolean Flags whether an image may be removed (editor's value is set to null).
options.autoUpload boolean Flags whether to upload (or process any other way) an image after it has been selected via file explorer. Instead, method upload can be called on editor to do it manually.
options.refreshPreviewAfterUpload boolean Flags whether to refresh editor with value returned by upload method. This only makes sense when upload method returns value coresponding to image other than image used as argument to upload method.
options.controller BaseAvatarEditorController Data provider controller in the form of subclass of BaseAvatarEditorController.

Extends

Members


hasFocus

Indicates whether the editor has focus.
Inherited From:

Methods


blur()

Clears the focus.
Inherited From:

commit( [options])

Update the model with the internal editor's value.
Parameters:
Name Type Argument Description
options Object <optional>
Options to pass to model.set().
Properties
Name Type Argument Description
validate Boolean <optional>
Set to true to trigger built-in model validation.
Inherited From:
Returns:
Returns an error object { type, message } if validation fails and options.forceCommit is turned off. undefined otherwise.
Type
Object | undefined

focus()

Sets the focus onto this editor.
Inherited From:

getEnabled()

Returns the value of `enabled` flag.
Inherited From:
Returns:
Type
Boolean

getModelValue()

Retrieves actual value of the bound attribute from the model.
Inherited From:
Returns:
Type
*

getReadonly()

Returns the value of `readonly` flag.
Inherited From:
Returns:
Type
Boolean

getValue()

Returns internal editor's value.
Inherited From:
Returns:
Type
*

setEnabled(enabled)

Sets a new value of enabled flag. While disabled, the editor's value cannot be changed or copied by the user. It's implied that the value doesn't make sense.
Parameters:
Name Type Description
enabled Boolean New flag value.
Inherited From:

setReadonly(readonly)

Sets a new value of readonly flag. While readonly, the editor's value cannot be changed but can be copied by the user.
Parameters:
Name Type Description
readonly Boolean New flag value.
Inherited From:

setValue(value)

Sets new internal editor's value.
Parameters:
Name Type Description
value * The new value.
Inherited From:

updateValue()

Manually updated editor's internal value with the value from this.model.get(this.key). Shouldn't be called normally. The method is called internally on model's change event.
Inherited From:

validate()

Check validity with built-in validator functions (initially passed into constructor options).
Inherited From:
Returns:
Returns an error object { type, message } if validation fails. undefined otherwise.
Type
Object | undefined