Search results

RadioButton

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>

Properties

checked

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

cssClass

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

disabled

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

enablePersistence

boolean

Enable or disable persisting component’s state between page reloads.

Defaults to false

enableRtl

boolean

Enable or disable rendering component in right to left direction.

Defaults to false

label

string

Defines the caption for the RadioButton, that describes the purpose of the RadioButton.

Defaults to

labelPosition

string

Positions label before/after the RadioButton. The possible values are:

  • Before: The label is positioned to left of the RadioButton.
  • After: The label is positioned to right of the RadioButton.

Defaults to ‘After’

locale

string

Overrides the global culture and localization value for this component. Default global culture is ‘en-US’.

Defaults to undefined

name

string

Defines name attribute for the RadioButton. It is used to reference form data (RadioButton value) after a form is submitted.

Defaults to

value

string

Defines value attribute for the RadioButton. It is a form data passed to the server when submitting the form.

Defaults to

Methods

addEventListener

Adds the handler to the given event listener.

Returns void

appendTo

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

dataBind

When invoked, applies the pending property changes immediately to the component.

Returns void

destroy

Destroys the widget.

Returns void

refresh

Applies all the pending property changes and render the component again.

Returns void

removeEventListener

Removes the handler from the given event listener.

Returns void

Inject

Dynamically injects the required modules to the component.

Returns void

Events

change

EmitType<ChangeArgs>

Event trigger when the RadioButton state has been changed by user interaction.

created

EmitType<Event>

Triggers once the component rendering is completed.