Search results

SwitchComponent

Represents the Essential JS 2 VueJS Switch Component.

<ejs-switch></ejs-switch>

Properties

checked

boolean

Specifies a value that indicates whether the Switch is checked or not. When set to true, the Switch will be in checked state.

cssClass

string

You can add custom styles to the Switch by using this property.

disabled

boolean

Specifies a value that indicates whether the Switch is disabled or not. When set to true, the Switch will be in disabled state.

enablePersistence

boolean

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

enableRtl

boolean

Enable or disable rendering component in right to left direction.

locale

string

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

name

string

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

offLabel

string

Specifies a text that indicates the Switch is in unchecked state.

onLabel

string

Specifies a text that indicates the Switch is in checked state.

value

string

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

Methods

click

Click the switch element its native method

Returns void

destroy

Destroys the Switch widget.

Returns void

focusIn

Sets the focus to Switch its native method

Returns void

toggle

Toggle the Switch component state into checked/unchecked.

Returns void

Events

change

EmitType<ChangeEventArgs>

Triggers when Switch state has been changed by user interaction.

created

EmitType<Event>

Triggers once the component rendering is completed.