CKEDITOR.dialog.definition.textInput
The definition of a text field (single line).
This class is not really part of the API. It just illustrates the properties that developers can use to define and create text fields.
Once the dialog is opened, the created element becomes a CKEDITOR.ui.dialog.textInput 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.
{
type: 'text',
id: 'name',
label: 'Your name',
'default': '',
validate: function() {
if ( !this.getValue() ) {
api.openMsgDialog( '', 'Name cannot be empty.' );
return false;
}
}
}
Filtering
Properties
-
align : StringCKEDITOR.dialog.definition.textInput#alignHorizontal alignment (in the container) of the UI element.
-
bidi : BooleanCKEDITOR.dialog.definition.textInput#bidiWhether 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:
This marker allows for restoring the same text direction upon the next dialog opening.
-
className : StringCKEDITOR.dialog.definition.textInput#classNameCSS class names to append to the UI element.
-
commit : FunctionCKEDITOR.dialog.definition.textInput#commitFunction 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.
-
Specify the inline style of the input element container.
{ type: 'text', label: 'My Label', controlStyle: 'width: 3em' } -
default : StringCKEDITOR.dialog.definition.textInput#defaultThe default value.
-
id : StringCKEDITOR.dialog.definition.textInput#idThe ID of the UI element.
-
Specify the inline style of the input element.
{ type: 'text', label: 'My Label', inputStyle: 'text-align: center' } -
label : StringCKEDITOR.dialog.definition.textInput#label -
labelLayout : StringCKEDITOR.dialog.definition.textInput#labelLayout(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 : StringCKEDITOR.dialog.definition.textInput#labelStyleSpecify the inline style of the uiElement label.
{ type: 'text', label: 'My Label', labelStyle: 'color: red' } -
maxLength : NumberCKEDITOR.dialog.definition.textInput#maxLength(Optional) The maximum length.
-
onHide : FunctionCKEDITOR.dialog.definition.textInput#onHideFunction to execute whenever the UI element's parent dialog is closed.
-
onLoad : FunctionCKEDITOR.dialog.definition.textInput#onLoadFunction to execute the first time the UI element is displayed.
-
onShow : FunctionCKEDITOR.dialog.definition.textInput#onShowFunction to execute whenever the UI element's parent dialog is displayed.
-
requiredContent : String | Object | styleCKEDITOR.dialog.definition.textInput#requiredContentThe 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.
-
setup : FunctionCKEDITOR.dialog.definition.textInput#setupFunction 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.
-
size : NumberCKEDITOR.dialog.definition.textInput#size(Optional) The size of the input field.
-
style : StringCKEDITOR.dialog.definition.textInput#styleInline CSS classes to append to the UI element.
-
title : StringCKEDITOR.dialog.definition.textInput#titleThe popup label of the UI element.
-
type : StringCKEDITOR.dialog.definition.textInput#typeThe type of the UI element. Required.
-
validate : FunctionCKEDITOR.dialog.definition.textInput#validate(Optional) The validation function.
-
widths : ArrayCKEDITOR.dialog.definition.textInput#widths(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] }