File

projects/components/src/widgets/common/switch/switch.component.doc.ts

Description

The wmSwitch component defines the switch widget.

Index

Methods
Inputs

Methods

onChange
onChange($event: MouseEvent, widget: any, newVal: any, oldVal: any)

Callback function which will be triggered when the widget is clicked or datavalue has changed.

Parameters :
Name Type Optional Description
$event MouseEvent No

DOM event on which call back is triggered

widget any No

Instance of the switch widget

newVal any No

datavalue of the switch widget

oldVal any No

previously selected datavalue of the switch widget

Returns : void
onClick
onClick($event: MouseEvent, widget: any)

Callback function which will be triggered when the widget is clicked.

Parameters :
Name Type Optional Description
$event MouseEvent No

DOM event on which call back is triggered

widget any No

Instance of the switch widget

Returns : void
onMouseenter
onMouseenter($event: MouseEvent, widget: any)

Callback function which will be triggered when the mouse enters the widget.

Parameters :
Name Type Optional Description
$event MouseEvent No

DOM event on which call back is triggered

widget any No

Instance of the switch widget

Returns : void
onMouseleave
onMouseleave($event: MouseEvent, widget: any)

Callback function which will be triggered when the mouse leaves the widget.

Parameters :
Name Type Optional Description
$event MouseEvent No

DOM event on which call back is triggered

widget any No

Instance of the switch widget

Returns : void
onTap
onTap($event: TouchEvent, widget: any)

Callback function which will be triggered when the tap event is triggered on a widget.

Parameters :
Name Type Optional Description
$event TouchEvent No

DOM event on which call back is triggered

widget any No

Instance of the switch widget

Returns : void

Inputs

class

Class of the widget.

Type : string

datafield

This property sets the dataValue to be returned by the switch widget when the list is populated using the dataSet property.

Type : string

dataset

This property accepts the options to create the switch widget. These options can be array of values, array of objects, object containing key-value pairs.

Bindable: true

Type : Array<any> | Object

Default value : 'yes, no, maybe'

datavalue

This property defines the initial selected value of the switch widget.

Bindable: true

Type : any

Default value : 'yes'

disabled

This property will be used to disable the switch widget. If the disabled property is true (checked), the widget becomes display-only.

Bindable: true

Type : boolean

displayexpression

This is an advanced property that gives more control over what is displayed in the switch options. A Display Expression uses a JavaScript expression to format exactly what is shown

Bindable: true

Type : string

displayfield

This property sets the displayValue to show in the switch widget when the list is populated using the dataSet property.

Type : string

hint

Hint text is shown for the switch widget on hover.

Bindable: true

Type : string

iconclass

CSS class of the icon.

Type : string

name

Name of the switch widget.

Type : string

orderby

Allows to display the data in asc or desc order based on this property

Type : string

required

This property will be used to validate the state of the switch widget when used inside a form widget.

Bindable: true

Type : boolean

show

This property will be used to show/hide the switch widget.

Bindable: true

Type : boolean

Default value : true

tabindex

This property specifies the tab order of the switch widget.

Type : number

Default value : 0

result-matching ""

    No results matching ""