The RadioButton is a graphical user interface element that allows you to select one option from the choices. It contains checked and unchecked states.
<input type="radio" id="radio"/>
<script>
var radioObj = new RadioButton({ label: "Default" });
radioObj.appendTo("#radio");
</script>
boolean
Specifies a value that indicates whether the RadioButton is checked
or not.
When set to true
, the RadioButton will be in checked
state.
Defaults to false
string
Defines class/multiple classes separated by a space in the RadioButton element. You can add custom styles to the RadioButton by using this property.
Defaults to ”
boolean
Specifies a value that indicates whether the RadioButton is disabled
or not.
When set to true
, the RadioButton will be in disabled
state.
Defaults to false
boolean
Specifies whether to enable the rendering of untrusted HTML values in the Radio Button component. If ‘enableHtmlSanitizer’ set to true, the component will sanitize any suspected untrusted strings and scripts before rendering them.
Defaults to true
boolean
Enable or disable persisting component’s state between page reloads.
Defaults to false
boolean
Enable or disable rendering component in right to left direction.
Defaults to false
{ : }
You can add the additional html attributes such as disabled, value etc., to the element. If you configured both property and equivalent html attribute then the component considers the property value.
Defaults to {}
string
Defines the caption for the RadioButton, that describes the purpose of the RadioButton.
Defaults to ”
Positions label before
/after
the RadioButton.
The possible values are:
Defaults to ‘After’
string
Overrides the global culture and localization value for this component. Default global culture is ‘en-US’.
Defaults to ”
string
Defines name
attribute for the RadioButton.
It is used to reference form data (RadioButton value) after a form is submitted.
Defaults to ”
string
Defines value
attribute for the RadioButton.
It is a form data passed to the server when submitting the form.
Defaults to ”
Adds the handler to the given event listener.
Parameter | Type | Description |
---|---|---|
eventName | string |
A String that specifies the name of the event |
handler | Function |
Specifies the call to run when the event occurs. |
Returns void
Appends the control within the given HTML element
Parameter | Type | Description |
---|---|---|
selector (optional) | string | HTMLElement |
Target element where control needs to be appended |
Returns void
Adding unload event to persist data when enable persistence true
Returns void
Click the RadioButton element its native method
Returns void
When invoked, applies the pending property changes immediately to the component.
Returns void
Destroys the widget.
Returns void
Removing unload event to persist data when enable persistence true
Returns void
Sets the focus to RadioButton its native method
Returns void
Returns the persistence data for component
Returns any
Returns the route element of the component
Returns HTMLElement
To get the value of selected radio button in a group.
Returns string
Handling unload event to persist data when enable persistence true
Returns void
Applies all the pending property changes and render the component again.
Returns void
Removes the handler from the given event listener.
Parameter | Type | Description |
---|---|---|
eventName | string |
A String that specifies the name of the event to remove |
handler | Function |
Specifies the function to remove |
Returns void
Dynamically injects the required modules to the component.
Parameter | Type | Description |
---|---|---|
moduleList | Function[] |
? |
Returns void
Event trigger when the RadioButton state has been changed by user interaction.
EmitType<Event>
Triggers once the component rendering is completed.