Class CKFinder.ui.dialog.uiElement
Constructor Attributes | Constructor Name and Description |
---|---|
CKFinder.ui.dialog.uiElement(dialog, elementDefinition, htmlList, nodeNameArg, stylesArg, attributesArg, contentsArg)
The base class of all dialog UI elements.
|
Method Attributes | Method Name and Description |
---|---|
disable()
Disables a UI element.
|
|
enable()
Enables a UI element.
|
|
focus()
Puts the focus to the UI object.
|
|
Gets the parent dialog object containing this UI element.
|
|
Gets the root DOM element of this dialog UI object.
|
|
Gets the DOM element that the user inputs values.
|
|
getValue()
Gets the current value of this dialog UI object.
|
|
Tells whether the UI object's value has changed.
|
|
Determines whether an UI element is enabled or not.
|
|
Determines whether an UI element is visible or not.
|
|
Selects the parent tab of this element.
|
|
setValue(value)
Sets the value of this dialog UI object.
|
Class Detail
CKFinder.ui.dialog.uiElement(dialog, elementDefinition, htmlList, nodeNameArg, stylesArg, attributesArg, contentsArg)
Since:
2.0
The base class of all dialog UI elements.
Note: the whole CKFinder.ui.dialog namespace is not directly accessible (CKFinder.ui.dialog is undefined).
Instances of this class are created by CKFinder when dialog is created.
To add a ui element to a dialog, check CKFinder.dialog.definition.uiElement.
Instances of this class are created by CKFinder when dialog is created.
- Parameters:
- {CKFinder.dialog} dialog
- Parent dialog object.
- {CKFinder.dialog.uiElementDefinition} elementDefinition
- Element
definition. Accepted fields:
- id (Required) The id of the UI element. See {@link CKFinder.dialog#getContentElement}
- type (Required) The type of the UI element. The value to this field specifies which UI element class will be used to generate the final widget.
- title (Optional) The popup tooltip for the UI element.
- hidden (Optional) A flag that tells if the element should be initially visible.
- className (Optional) Additional CSS class names to add to the UI element. Separated by space.
- style (Optional) Additional CSS inline styles to add to the UI element. A semicolon (;) is required after the last style declaration.
- accessKey (Optional) The alphanumeric access key for this element. Access keys are automatically prefixed by CTRL.
- on* (Optional) Any UI element definition field that starts with on followed immediately by a capital letter and probably more letters is an event handler. Event handlers may be further divided into registered event handlers and DOM event handlers. Please refer to CKFinder.ui.dialog.uiElement#registerEvents and CKFinder.ui.dialog.uiElement#eventProcessors for more information.
- {Array} htmlList
- List of HTML code to be added to the dialog's content area.
- {Function|String} nodeNameArg
- A function returning a string, or a simple string for the node name for the root DOM node. Default is 'div'.
- {Function|Object} stylesArg
- A function returning an object, or a simple object for CSS styles applied to the DOM node. Default is empty object.
- {Function|Object} attributesArg
- A fucntion returning an object, or a simple object for attributes applied to the DOM node. Default is empty object.
- {Function|String} contentsArg
- A function returning a string, or a simple string for the HTML code inside the root DOM node. Default is empty string.
Method Detail
{Undefined}
disable()
Since:
2.0
Disables a UI element.
{Undefined}
enable()
Since:
2.0
Enables a UI element.
{CKFinder.ui.dialog.uiElement}
focus()
Since:
2.0
Puts the focus to the UI object. Switches tabs if the UI object isn't in the active tab page.
uiElement.focus();
- Returns:
- {CKFinder.ui.dialog.uiElement} The current UI element.
{CKFinder.dialog}
getDialog()
Since:
2.0
Gets the parent dialog object containing this UI element.
var dialog = uiElement.getDialog();
- Returns:
- {CKFinder.dialog} Parent dialog object.
{CKFinder.dom.element}
getElement()
Since:
2.0
Gets the root DOM element of this dialog UI object.
uiElement.getElement().hide();
- Returns:
- {CKFinder.dom.element} Root DOM element of UI object.
{CKFinder.dom.element}
getInputElement()
Since:
2.0
Gets the DOM element that the user inputs values.
This function is used by setValue(), getValue() and focus(). It should
be overrided in child classes where the input element isn't the root
element.
var rawValue = textInput.getInputElement().$.value;
- Returns:
- {CKFinder.dom.element} The element where the user input values.
{Object}
getValue()
Since:
2.0
Gets the current value of this dialog UI object.
var myValue = uiElement.getValue();
- Returns:
- {Object} The current value.
{Boolean}
isChanged()
Since:
2.0
Tells whether the UI object's value has changed.
if ( uiElement.isChanged() ) confirm( 'Value changed! Continue?' );
- Returns:
- {Boolean} true if changed, false if not changed.
{Boolean}
isEnabled()
Since:
2.0
Determines whether an UI element is enabled or not.
- Returns:
- {Boolean} Whether the UI element is enabled.
{Boolean}
isVisible()
Since:
2.0
Determines whether an UI element is visible or not.
- Returns:
- {Boolean} Whether the UI element is visible.
{CKFinder.ui.dialog.uiElement}
selectParentTab()
Since:
2.0
Selects the parent tab of this element. Usually called by focus() or overridden focus() methods.
focus : function() { this.selectParentTab(); // do something else. }
- Returns:
- {CKFinder.ui.dialog.uiElement} The current UI element.
{CKFinder.ui.dialog.uiElement}
setValue(value)
Since:
2.0
Sets the value of this dialog UI object.
uiElement.setValue( 'Dingo' );
- Parameters:
- {Object} value
- The new value.
- Returns:
- {CKFinder.ui.dialog.uiElement} The current UI element.