Report an issue
Class

CKEDITOR.dialog.definition.textarea

class

The definition of a text field (multiple lines).

This class is not really part of the API. It just illustrates the properties that developers can use to define and create textarea.

Once the dialog is opened, the created element becomes a CKEDITOR.ui.dialog.textarea object and can be accessed with CKEDITOR.dialog.getContentElement.

For a complete example of dialog definition, please check CKEDITOR.dialog.add.

    // There is no constructor for this class, the user just has to define an
    // object with the appropriate properties.

    // Example:
    {
        type: 'textarea',
        id: 'message',
        label: 'Your comment',
        'default': '',
        validate: function() {
            if ( this.getValue().length < 5 ) {
                api.openMsgDialog( 'The comment is too short.' );
                return false;
            }
        }
    }

Filtering

Properties

  • align : String

    Horizontal alignment (in the container) of the UI element.

  • since 4.5.0

    bidi : Boolean

    Whether the text direction of this input should be togglable using the following keystrokes:

    • Shift+Alt+End – switch to Right-To-Left,
    • Shift+Alt+Home – switch to Left-To-Right.

    By default the input will be loaded without any text direction set, which means that the direction will be inherited from the editor's text direction.

    If the direction was set, a marker will be prepended to every non-empty value of this input:

    • \u202A – for Right-To-Left,
    • \u202B – for Left-To-Right.

    This marker allows for restoring the same text direction upon the next dialog opening.

  • className : String

    CSS class names to append to the UI element.

  • cols : Number

    The number of columns.

  • commit : Function

    Function to execute whenever the UI element's parent dialog's CKEDITOR.dialog.commitContent method is executed. It usually takes care of the respective UI element as a standalone element.

  • since 3.6.1

    controlStyle : String

    Specify the inline style of the input element container.

    {
        type: 'text',
        label: 'My Label',
        controlStyle: 'width: 3em'
    }
    
  • default : String

    The default value.

  • id : String

    The ID of the UI element.

  • since 3.6.1

    inputStyle : String

    Specify the inline style of the input element.

    {
        type: 'text',
        label: 'My Label',
        inputStyle: 'text-align: center'
    }
    
  • label : String

    The label of the UI element.

    {
        type: 'text',
        label: 'My Label'
    }
    
  • labelLayout : String

    (Optional) Specify the layout of the label. Set to 'horizontal' for horizontal layout. The default layout is vertical.

    {
        type: 'text',
        label: 'My Label',
        labelLayout: 'horizontal'
    }
    
  • labelStyle : String

    Specify the inline style of the uiElement label.

    {
        type: 'text',
        label: 'My Label',
        labelStyle: 'color: red'
    }
    
  • onHide : Function

    Function to execute whenever the UI element's parent dialog is closed.

  • onLoad : Function

    Function to execute the first time the UI element is displayed.

  • onShow : Function

    Function to execute whenever the UI element's parent dialog is displayed.

  • requiredContent : String | Object | style

    The content that needs to be allowed to enable this UI element. All formats accepted by CKEDITOR.filter.check may be used.

    When all UI elements in a tab are disabled, this tab will be disabled automatically.

  • rows : Number

    The number of rows.

  • setup : Function

    Function to execute whenever the UI element's parent dialog's CKEDITOR.dialog.setupContent method is executed. It usually takes care of the respective UI element as a standalone element.

  • style : String

    Inline CSS classes to append to the UI element.

  • title : String

    The popup label of the UI element.

  • type : String

    The type of the UI element. Required.

  • validate : Function

    (Optional) The validation function.

  • widths : Array

    (Optional) Applies only to horizontal layouts: a two elements array of lengths to specify the widths of the label and the content element. See also labelLayout.

    {
        type: 'text',
        label: 'My Label',
        labelLayout: 'horizontal',
        widths: [100, 200]
    }