class UIToggle
A view control that represents a checkbox or toggle input.
class UIToggle extends UIComponent
Description
A toggle component is rendered on-screen as a checkbox or toggle control that can be switched on and off by the user.
Constructor
- constructor(label?, state?)Creates a new toggle view object with the specified label.
Type Members
- type UIToggle.StyleType staticThe type definition for styles applicable to UIToggle.style.
- type UIToggle.LabelStyleType staticThe type definition for styles applicable to UIToggle.labelStyle.
Instance Members
- applyViewPreset(preset)Applies the provided preset properties to this object.
- stateThe current toggle state, true for toggle ‘on’ state.
- labelThe toggle label to be displayed, if any.
- formFieldForm context field name, used with UIFormContext.
- formContextThe nearest containing form context.
- disabledTrue if user input should be disabled on this control.
- styleThe style to be applied to the toggle control as a whole.
- labelStyleThe style to be applied to the toggle label.
Inherited Members
- hiddenTrue if the component should be hidden from view.
- positionOptions related to the position of this component.
- accessibleRoleWAI-ARIA role for this component, if applicable.
- accessibleLabelWAI-ARIA label text for this component (not tooltip), if applicable.
- requestFocus()Requests input focus on this component.
- requestFocusNext()Requests input focus for the next sibling component.
- requestFocusPrevious()Requests input focus for the previous sibling component.
- render(callback)Triggers asynchronous rendering for this component, and all contained components, if any.
- findViewContent(type)Implementation of View.findViewContent(), returns an empty array unless overridden.
- lastRenderOutputLast rendered output, if any; set by the UI component renderer.
- emit(event)Emits an event, immediately calling all event handlers.
- emitChange(name?, data?)Emits a change event, an instance of ManagedChangeEvent.
- listen(handler)Adds a handler for all events emitted by this object.
- isUnlinked()Returns true if the object has been unlinked.
- unlink()Unlinks this managed object.
- beforeUnlink() protectedA method that’s called immediately before unlinking an object, can be overridden.
- attach(target, observer?) protectedAttaches the provided managed object to this object.
- autoAttach(propertyName, observer?) protectedObserves a property, so that any object assigned to it is attached immediately.