tinymce.ui.Radio
Creates a new radio button.
Settings
name | type | summary | defined by |
---|---|---|---|
autofocus | Boolean | True if the control should be focused when rendered. | tinymce.ui.Widget |
border | String | Border box values example: 1 1 1 1 | tinymce.ui.Control |
checked | Boolean | True if the checkbox should be checked by default. | tinymce.ui.Checkbox |
classes | String | Space separated list of classes to add. | tinymce.ui.Control |
disabled | Boolean | Is the control disabled by default. | tinymce.ui.Control |
hidden | Boolean | Is the control hidden by default. | tinymce.ui.Control |
margin | String | Margin box values example: 1 1 1 1 | tinymce.ui.Control |
minHeight | Number | Minimal height for the control. | tinymce.ui.Control |
minWidth | Number | Minimal width for the control. | tinymce.ui.Control |
name | String | Name of the control instance. | tinymce.ui.Control |
padding | String | Padding box values example: 1 1 1 1 | tinymce.ui.Control |
role | String | WAI-ARIA role to use for control. | tinymce.ui.Control |
style | String | Style CSS properties to add. | tinymce.ui.Control |
text | String | Text to display inside widget. | tinymce.ui.Widget |
tooltip | String | Tooltip text to display when hovering. | tinymce.ui.Widget |
Constructors
name | summary | defined by |
---|---|---|
Checkbox() | Constructs a new Checkbox instance with the specified settings. | tinymce.ui.Checkbox |
Control() | Constructs a new control instance with the specified settings. | tinymce.ui.Control |
Widget() | Constructs a instance with the specified settings. | tinymce.ui.Widget |
Methods
name | summary | defined by |
---|---|---|
active() | Sets/gets the active for the control. | tinymce.ui.Control |
after() | Adds items after the current control. | tinymce.ui.Control |
aria() | Sets the specified aria property. | tinymce.ui.Control |
before() | Adds items before the current control. | tinymce.ui.Control |
blur() | Blurs the current control. | tinymce.ui.Control |
checked() | Getter/setter function for the checked state. | tinymce.ui.Checkbox |
disabled() | Sets/gets the disabled state on the control. | tinymce.ui.Control |
encode() | Encodes the specified string with HTML entities. It will also translate the string to different languages. | tinymce.ui.Control |
fire() | Fires the specified event by name and arguments on the control. This will execute all bound event handlers. | tinymce.ui.Control |
focus() | Focuses the current control. | tinymce.ui.Control |
getContainerElm() | Returns the root element to render controls into. | tinymce.ui.Control |
getEl() | Returns the control DOM element or sub element. | tinymce.ui.Control |
getParentCtrl() | Returns a control instance for the current DOM element. | tinymce.ui.Control |
hasEventListeners() | Returns true/false if the specified event has any listeners. | tinymce.ui.Control |
hide() | Sets the visible state to false. | tinymce.ui.Control |
initLayoutRect() | Initializes the current controls layout rect. This will be executed by the layout managers to determine the default minWidth/minHeight etc. | tinymce.ui.Control |
innerHtml() | Sets the inner HTML of the control element. | tinymce.ui.Control |
layoutRect() | Getter/setter for the current layout rect. | tinymce.ui.Control |
name() | Sets/gets the name for the control. | tinymce.ui.Control |
next() | Returns the control next to the current control. | tinymce.ui.Control |
off() | Unbinds the specified event and optionally a specific callback. If you omit the name parameter all event handlers will be removed. If you omit the callback all event handles by the specified name will be removed. | tinymce.ui.Control |
on() | Binds a callback to the specified event. This event can both be native browser events like "click" or custom ones like PostRender. The callback function will be passed a DOM event like object that enables yout do stop propagation. | tinymce.ui.Control |
parent() | Sets/gets the parent container for the control. | tinymce.ui.Control |
parents() | Returns a control collection with all parent controls. | tinymce.ui.Control |
parentsAndSelf() | Returns the current control and it's parents. | tinymce.ui.Control |
postRender() | Called after the control has been rendered. | tinymce.ui.Widget |
prev() | Returns the control previous to the current control. | tinymce.ui.Control |
reflow() | Reflows the current control and it's parents. This should be used after you for example append children to the current control so that the layout managers know that they need to reposition everything. | tinymce.ui.Control |
remove() | Removes the current control from DOM and from UI collections. | tinymce.ui.Widget |
renderBefore() | Renders the control to the specified element. | tinymce.ui.Control |
renderHtml() | Renders the control as a HTML string. | tinymce.ui.Checkbox |
repaint() | Repaints the control after a layout operation. | tinymce.ui.Control |
scrollIntoView() | Scrolls the current control into view. | tinymce.ui.Control |
show() | Sets the visible state to true. | tinymce.ui.Control |
text() | Sets/gets the text for the control. | tinymce.ui.Control |
title() | Sets/gets the title for the control. | tinymce.ui.Control |
tooltip() | Returns the current tooltip instance. | tinymce.ui.Widget |
translate() | Returns the translated string. | tinymce.ui.Control |
value() | Getter/setter function for the value state. | tinymce.ui.Checkbox |
visible() | Sets/gets the visible for the control. | tinymce.ui.Control |
Constructors
Checkbox
Constructs a new Checkbox instance with the specified settings.
Parameters
- settings (Object) - Name/value object with settings.
Control
Constructs a new control instance with the specified settings.
Parameters
- settings (Object) - Name/value object with settings.
Widget
Constructs a instance with the specified settings.
Parameters
- settings (Object) - Name/value object with settings.
Methods
active
Sets/gets the active for the control.
Parameters
- state (Boolean) - Value to set to control.
Return value
- Boolean - Current control on a set operation or current state on a get.
- tinymce.ui.Control - Current control on a set operation or current state on a get.
after
Adds items after the current control.
Parameters
- items (Array) - Array of items to append after this control.
Return value
- tinymce.ui.Control - Current control instance.
aria
Sets the specified aria property.
Parameters
- name (String) - Name of the aria property to set.
- value (String) - Value of the aria property.
Return value
- tinymce.ui.Control - Current control instance.
before
Adds items before the current control.
Parameters
- items (Array) - Array of items to prepend before this control.
Return value
- tinymce.ui.Control - Current control instance.
blur
Blurs the current control.
Return value
- tinymce.ui.Control - Current control instance.
checked
Getter/setter function for the checked state.
Parameters
- state (Boolean) - State to be set.
Return value
- Boolean - True/false or checkbox if it's a set operation.
- tinymce.ui.Checkbox - True/false or checkbox if it's a set operation.
disabled
Sets/gets the disabled state on the control.
Parameters
- state (Boolean) - Value to set to control.
Return value
- Boolean - Current control on a set operation or current state on a get.
- tinymce.ui.Control - Current control on a set operation or current state on a get.
encode
Encodes the specified string with HTML entities. It will also translate the string to different languages.
Parameters
- text (String) - Text to entity encode.
- translate (Boolean) - False if the contents shouldn't be translated.
Return value
- String - Encoded and possible traslated string.
fire
Fires the specified event by name and arguments on the control. This will execute all bound event handlers.
Parameters
- name (String) - Name of the event to fire.
- args (Object) - Arguments to pass to the event.
- bubble (Boolean) - Value to control bubbling. Defaults to true.
Return value
- Object - Current arguments object.
focus
Focuses the current control.
Return value
- tinymce.ui.Control - Current control instance.
getContainerElm
Returns the root element to render controls into.
Return value
- Element - HTML DOM element to render into.
getEl
Returns the control DOM element or sub element.
Parameters
- suffix (String) - Suffix to get element by.
Return value
- Element - HTML DOM element for the current control or it's children.
getParentCtrl
Returns a control instance for the current DOM element.
Parameters
- elm (Element) - HTML dom element to get parent control from.
Return value
- tinymce.ui.Control - Control instance or undefined.
hasEventListeners
Returns true/false if the specified event has any listeners.
Parameters
- name (String) - Name of the event to check for.
Return value
- Boolean - True/false state if the event has listeners.
hide
Sets the visible state to false.
Return value
- tinymce.ui.Control - Current control instance.
initLayoutRect
Initializes the current controls layout rect. This will be executed by the layout managers to determine the default minWidth/minHeight etc.
Return value
- Object - Layout rect instance.
innerHtml
Sets the inner HTML of the control element.
Parameters
- html (String) - Html string to set as inner html.
Return value
- tinymce.ui.Control - Current control object.
layoutRect
Getter/setter for the current layout rect.
Parameters
- newRect (Object) - Optional new layout rect.
Return value
- tinymce.ui.Control - Current control or rect object.
- Object - Current control or rect object.
name
Sets/gets the name for the control.
Parameters
- value (String) - Value to set to control.
Return value
- String - Current control on a set operation or current value on a get.
- tinymce.ui.Control - Current control on a set operation or current value on a get.
next
Returns the control next to the current control.
Return value
- tinymce.ui.Control - Next control instance.
off
Unbinds the specified event and optionally a specific callback. If you omit the name parameter all event handlers will be removed. If you omit the callback all event handles by the specified name will be removed.
Parameters
- name (String) - Name for the event to unbind.
- callback (function) - Callback function to unbind.
Return value
- tinymce.ui.Control - Current control object.
on
Binds a callback to the specified event. This event can both be native browser events like "click" or custom ones like PostRender. The callback function will be passed a DOM event like object that enables yout do stop propagation.
Parameters
- name (String) - Name of the event to bind. For example "click".
- callback (String) - Callback function to execute ones the event occurs.
Return value
- tinymce.ui.Control - Current control object.
parent
Sets/gets the parent container for the control.
Parameters
- parent (tinymce.ui.Container) - Optional parent to set.
Return value
- tinymce.ui.Control - Parent control or the current control on a set action.
parents
Returns a control collection with all parent controls.
Parameters
- selector (String) - Optional selector expression to find parents.
Return value
- tinymce.ui.Collection - Collection with all parent controls.
parentsAndSelf
Returns the current control and it's parents.
Parameters
- selector (String) - Optional selector expression to find parents.
Return value
- tinymce.ui.Collection - Collection with all parent controls.
postRender
Called after the control has been rendered.
prev
Returns the control previous to the current control.
Return value
- tinymce.ui.Control - Previous control instance.
reflow
Reflows the current control and it's parents. This should be used after you for example append children to the current control so that the layout managers know that they need to reposition everything.
Examples
container.append({type: 'button', text: 'My button'}).reflow();
Return value
- tinymce.ui.Control - Current control instance.
remove
Removes the current control from DOM and from UI collections.
Return value
- tinymce.ui.Control - Current control instance.
renderBefore
Renders the control to the specified element.
Parameters
- elm (Element) - Element to render to.
Return value
- tinymce.ui.Control - Current control instance.
renderHtml
Renders the control as a HTML string.
Return value
- String - HTML representing the control.
repaint
Repaints the control after a layout operation.
scrollIntoView
Scrolls the current control into view.
Parameters
- align (String) - Alignment in view top|center|bottom.
Return value
- tinymce.ui.Control - Current control instance.
show
Sets the visible state to true.
Return value
- tinymce.ui.Control - Current control instance.
text
Sets/gets the text for the control.
Parameters
- value (String) - Value to set to control.
Return value
- String - Current control on a set operation or current value on a get.
- tinymce.ui.Control - Current control on a set operation or current value on a get.
title
Sets/gets the title for the control.
Parameters
- value (String) - Value to set to control.
Return value
- String - Current control on a set operation or current value on a get.
- tinymce.ui.Control - Current control on a set operation or current value on a get.
tooltip
Returns the current tooltip instance.
Return value
- tinymce.ui.Tooltip - Tooltip instance.
translate
Returns the translated string.
Parameters
- text (String) - Text to translate.
Return value
- String - Translated string or the same as the input.
value
Getter/setter function for the value state.
Parameters
- state (Boolean) - State to be set.
Return value
- Boolean - True/false or checkbox if it's a set operation.
- tinymce.ui.Checkbox - True/false or checkbox if it's a set operation.
visible
Sets/gets the visible for the control.
Parameters
- state (Boolean) - Value to set to control.
Return value
- Boolean - Current control on a set operation or current state on a get.
- tinymce.ui.Control - Current control on a set operation or current state on a get.
Can't find what you're looking for? Let us know.
Except as otherwise noted, the content of this page is licensed under the Creative Commons BY-NC-SA 3.0 License, and code samples are licensed under the Apache 2.0 License.