# Class: TextAreaEditorView

## module:core.form.editors. TextAreaEditorView

Multiline text editor. Supported data type: `String`.

#### new TextAreaEditorView(options)

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `options` | Object | Options object. All the properties of BaseEditorView class are also supported. ###### Properties
  Name | Type | Argument | Default | Description
  --- | --- | --- | --- | ---
  `maxLength` | Number | null | <optional> | null | The maximum number of characters. Not limited if `null`.
  `changeMode` | String | <optional> | 'blur' | Determines the moment the editor's value is updated: `'keydown'` - on key press. `'blur'` - on focus out.
  `size` | String | <optional> | 'auto' | Determines the strategy to compute the editor's height: `'auto'` - determined by the content (withing the range [`minHeight`, `maxHeight`]). `'fixed'` - fixed, determined by `height` option.
  `emptyPlaceholder` | String | <optional> | 'Field is empty' | Empty text placeholder.
  `readonlyPlaceholder` | String | <optional> | 'Field is readonly' | Текст placeholder, отображаемый в случае если эдитор имеет флаг `readonly`.
  `disablePlaceholder` | String | <optional> | 'Field is disabled' | Текст placeholder, отображаемый в случае если эдитор имеет флаг `enabled: false`.
  `height` | Number | <optional> | null | The height of the editor (in rows) when its size is fixed.
  `minHeight` | Number | <optional> | 2 | The minimum height of the editor (in rows).
  `maxHeight` | Number | <optional> | 30 | The maximum height of the editor (in rows).

### Extends

- module:core.form.editors.base.BaseEditorView

### Members

#### hasFocus

  Indicates whether the editor has focus.
  Inherited From:
    - module:core.form.editors.base.BaseEditorView#hasFocus

### Methods

#### addKeyboardListener(key, callback)

  Позволяет добавить callback-функцию на ввод определенной клавиши или комбинации клавиш. Использует метод simple_combo плагина [Keypress](https://dmauro.github.io/Keypress/).

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `key` | String | Комбинация клавиш или несколько комбинаций, разделенных запятыми. Полный список с названиями клавиш указан в исходном файле плагина: [keypress.coffee](https://github.com/dmauro/Keypress/blob/master/keypress.coffee#L750-912).
  `callback` | String | Callback-функция, вызываемая по срабатыванию комбо.

#### blur()

  Clears the focus.
  Inherited From:
    - module:core.form.editors.base.BaseEditorView#blur

#### 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:
    - module:core.form.editors.base.BaseEditorView#commit

  ##### 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:
    - module:core.form.editors.base.BaseEditorView#focus

#### getEnabled()

  Returns the value of `enabled` flag.
  Inherited From:
    - module:core.form.editors.base.BaseEditorView#getEnabled

  ##### Returns:

  Type
    Boolean

#### getModelValue()

  Retrieves actual value of the bound attribute from the model.
  Inherited From:
    - module:core.form.editors.base.BaseEditorView#getModelValue

  ##### Returns:

  Type
    *

#### getReadonly()

  Returns the value of `readonly` flag.
  Inherited From:
    - module:core.form.editors.base.BaseEditorView#getReadonly

  ##### Returns:

  Type
    Boolean

#### getValue()

  Returns internal editor's value.
  Inherited From:
    - module:core.form.editors.base.BaseEditorView#getValue

  ##### Returns:

  Type
    *

#### select()

  Focuses the editor's input and selects all the text in it.

#### setCaretPos(position)

  Метод позволяет установить позицию курсора.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `position` | Number | Новая позиция курсора.

#### 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:
    - module:core.form.editors.base.BaseEditorView#setEnabled

#### 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:
    - module:core.form.editors.base.BaseEditorView#setReadonly

#### setValue(value)

  Sets new internal editor's value.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `value` | * | The new value.

  Inherited From:
    - module:core.form.editors.base.BaseEditorView#setValue

#### 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:
    - module:core.form.editors.base.BaseEditorView#updateValue

#### validate()

  Check validity with built-in validator functions (initially passed into constructor options).
  Inherited From:
    - module:core.form.editors.base.BaseEditorView#validate

  ##### Returns:

  Returns an error object `{ type, message }` if validation fails. `undefined` otherwise.
  Type
    Object | undefined

#### Search results