new UWA.Controls.Input.Radio()
Radio input. Inherits from Input._ToggleInput.
Available CSS Classes
The className option can be composed of one or more of those CSS classes:
Class name | Description |
---|---|
light |
Use this class if it will be on a dark background |
Extends
Index
Members
Methods
Members
-
name
-
Properties:
Name Type Description name
String The input name. Default: 'uwa-radio'.
-
<protected> options
-
- Inherited From:
Properties:
Name Type Description defaultOptions
Object The default controls options.
-
<protected> _hiddenInput
-
- Inherited From:
Properties:
Name Type Description _hiddenInput
Boolean If the input element should be displayed or emulated with some generated DOM. Default: false.
-
<protected> elements :Object
-
The current control elements.
Type
- Object
Methods
-
isChecked() → {Boolean}
-
Get if this input is checked
Returns
- Type
- Boolean
-
focus(y) → {Object}
-
Set the focus of this input
Parameters
Name Type Argument Default Description y
Boolean <optional>
true if false, blurs the focus
Returns
this
- Type
- Object
- Inherited From:
-
check(y) → {this}
-
Check or uncheck the input.
Parameters
Name Type Argument Default Description y
Boolean <optional>
true If
false
, uncheck the inputReturns
- Type
- this
- Inherited From:
-
isDisabled() → {Boolean}
-
Get if this input is disabled
Returns
- Type
- Boolean
-
setDisabled(y) → {this}
-
Set the input as disabled
Parameters
Name Type Argument Default Description y
Boolean <optional>
true If
false
, enable the input.Returns
- Type
- this
-
getValue() → {String}
-
Get the input value. To override if needed.
Returns
The input value
- Type
- String
-
setValue(value) → {this}
-
Set the input value. To override if needed.
Parameters
Name Type Description value
String The new value
Returns
- Type
- this
-
getContent() → {HTMLelement}
-
Returns control content.
Returns
Control container.
- Type
- HTMLelement
-
getInputElement() → {HTMLelement}
-
Returns the native input element
Returns
- Type
- HTMLelement
-
inject(element, where) → {this}
-
Inject control in the dom.
Parameters
Name Type Argument Description element
HTMLelement Dom target
where
String <optional>
Where to inject
Returns
- Type
- this
- Inherited From:
-
remove() → {this}
-
Remove the control from the dom
Returns
- Type
- this
- Inherited From:
-
getClassNames(suffixes) → {String}
-
Generate a CSS class name based on the class
name
property, its parent classes, and the options "className". It should be used internally (in the control).Example
var Input = UWA.Controls.Abstract.extend({ name: 'uwa-input', options: { className: '', }, buildSkeleton: function () { this.elements.container = UWA.createElement('div', { 'class': this.getClassNames() }); this.elements.content = UWA.createElement('div', { 'class': this.getClassNames('-content') }); } }); var Radio = Input.extend({ name: 'uwa-inputradio' }); new Radio({ className: 'toto black' }); // container will have the class 'toto black uwa-inputradio uwa-input' // content will have the class 'toto black uwa-inputradio-content uwa-input-content'
Parameters
Name Type Description suffixes
String All parameters should be strings, used as suffix to append to the UWA.Class names of the inheritance chain.
Returns
The generated CSS class name.
- Type
- String
-
hide()
-
Hide control content.
- Inherited From:
-
show()
-
Show control content.
- Inherited From:
-
destroy()
-
Destroy the control elements and its children. Remove all events and remove the element from the dom. This control and its children should not be used after this.