| Name | Type | Default |
|
checked
# |
Boolean
|
false
|
Sets or gets the checked property.
import { Component } from '@angular/core';
import { jqxSwitchButtonModule } from 'jqwidgets-ng/jqxswitchbutton';
@Component({
selector: 'app-root',
imports: [jqxSwitchButtonModule],
template: `
<jqxSwitchButton #mySwitchButton [width]="81" [height]="27" [checked]="true">
</jqxSwitchButton>
`
})
export class App {}
|
|
disabled
# |
Boolean
|
false
|
Sets or gets the disabled property.
import { Component } from '@angular/core';
import { jqxSwitchButtonModule } from 'jqwidgets-ng/jqxswitchbutton';
@Component({
selector: 'app-root',
imports: [jqxSwitchButtonModule],
template: `
<jqxSwitchButton #mySwitchButton [width]="81" [height]="27" [disabled]="true">
</jqxSwitchButton>
`
})
export class App {}
|
|
height
# |
String | Number
|
null
|
Sets or gets the height property.
import { Component } from '@angular/core';
import { jqxSwitchButtonModule } from 'jqwidgets-ng/jqxswitchbutton';
@Component({
selector: 'app-root',
imports: [jqxSwitchButtonModule],
template: ` <jqxSwitchButton #mySwitchButton [width]="81" [height]="27"> </jqxSwitchButton> `
})
export class App {}
|
|
orientation
# |
enum:SwitchButtonOrientation
|
'horizontal'
|
enum SwitchButtonOrientation { horizontal, vertical } Sets or gets the orientation property.
import { Component } from '@angular/core';
import { jqxSwitchButtonModule } from 'jqwidgets-ng/jqxswitchbutton';
@Component({
selector: 'app-root',
imports: [jqxSwitchButtonModule],
template: `
<jqxSwitchButton #mySwitchButton [width]="81" [height]="27" [orientation]="''vertical''">
</jqxSwitchButton>
`
})
export class App {}
|
|
onLabel
# |
String
|
'On'
|
Sets or gets the onLabel property.
import { Component } from '@angular/core';
import { jqxSwitchButtonModule } from 'jqwidgets-ng/jqxswitchbutton';
@Component({
selector: 'app-root',
imports: [jqxSwitchButtonModule],
template: `
<jqxSwitchButton #mySwitchButton [width]="81" [height]="27" [onLabel]="'On'">
</jqxSwitchButton>
`
})
export class App {}
|
|
offLabel
# |
String
|
'Off'
|
Sets or gets the offLabel property.
import { Component } from '@angular/core';
import { jqxSwitchButtonModule } from 'jqwidgets-ng/jqxswitchbutton';
@Component({
selector: 'app-root',
imports: [jqxSwitchButtonModule],
template: `
<jqxSwitchButton #mySwitchButton [width]="81" [height]="27" [offLabel]="'Off'">
</jqxSwitchButton>
`
})
export class App {}
|
|
theme
# |
String
|
''
|
import { Component, viewChild } from '@angular/core';
import { jqxSwitchButtonComponent, jqxSwitchButtonModule } from 'jqwidgets-ng/jqxswitchbutton';
@Component({
selector: 'app-root',
imports: [jqxSwitchButtonModule],
template: `<jqxSwitchButton #mySwitchButton [theme]="'material'"> </jqxSwitchButton>`,
styles: [``]
})
export class App {
readonly mySwitchButton = viewChild.required<jqxSwitchButtonComponent>('mySwitchButton');
}
|
|
thumbSize
# |
String
|
'40%'
|
Sets or gets the thumbSize property.
import { Component } from '@angular/core';
import { jqxSwitchButtonModule } from 'jqwidgets-ng/jqxswitchbutton';
@Component({
selector: 'app-root',
imports: [jqxSwitchButtonModule],
template: `
<jqxSwitchButton #mySwitchButton [width]="81" [height]="27" [thumbSize]="30%">
</jqxSwitchButton>
`
})
export class App {}
|
|
rtl
# |
Boolean
|
false
|
Sets or gets the rtl property.
import { Component } from '@angular/core';
import { jqxSwitchButtonModule } from 'jqwidgets-ng/jqxswitchbutton';
@Component({
selector: 'app-root',
imports: [jqxSwitchButtonModule],
template: `
<jqxSwitchButton #mySwitchButton [width]="81" [height]="27" [rtl]="true"> </jqxSwitchButton>
`
})
export class App {}
|
|
width
# |
String | Number
|
null
|
Sets or gets the width property.
import { Component } from '@angular/core';
import { jqxSwitchButtonModule } from 'jqwidgets-ng/jqxswitchbutton';
@Component({
selector: 'app-root',
imports: [jqxSwitchButtonModule],
template: ` <jqxSwitchButton #mySwitchButton [width]="81" [height]="27"> </jqxSwitchButton> `
})
export class App {}
|
|
|
|
checked
# |
Event
|
|
This event is triggered when the switch button is checked.
Code examples #
Bind to the checked event of jqxSwitchButton.
import { Component } from '@angular/core';
import { jqxSwitchButtonModule } from 'jqwidgets-ng/jqxswitchbutton';
@Component({
selector: 'app-root',
imports: [jqxSwitchButtonModule],
template: `
<jqxSwitchButton #mySwitchButton(onChecked)="Checked($event)" [width]="81" [height]="27">
</jqxSwitchButton>
`
})
export class App {
Checked(event: any): void {
// Do Something
}
}
|
|
change
# |
Event
|
|
This event is triggered when the switch button's state changes from one state to another.
Code examples #
Bind to the change event of jqxSwitchButton.
import { Component } from '@angular/core';
import { jqxSwitchButtonModule } from 'jqwidgets-ng/jqxswitchbutton';
@Component({
selector: 'app-root',
imports: [jqxSwitchButtonModule],
template: `
<jqxSwitchButton #mySwitchButton(onChange)="Change($event)" [width]="81" [height]="27">
</jqxSwitchButton>
`
})
export class App {
Change(event: any): void {
// Do Something
}
}
|
|
unchecked
# |
Event
|
|
This event is triggered when the switch button is unchecked.
Code examples #
Bind to the unchecked event of jqxSwitchButton.
import { Component } from '@angular/core';
import { jqxSwitchButtonModule } from 'jqwidgets-ng/jqxswitchbutton';
@Component({
selector: 'app-root',
imports: [jqxSwitchButtonModule],
template: `
<jqxSwitchButton
#mySwitchButton(onUnchecked)="Unchecked($event)"
[width]="81"
[height]="27"
>
</jqxSwitchButton>
`
})
export class App {
Unchecked(event: any): void {
// Do Something
}
}
|
|
|
| Name | Return Type | Arguments |
|
check
# |
Void
|
None
|
import { Component, AfterViewInit, viewChild } from '@angular/core';
import { jqxSwitchButtonModule, jqxSwitchButtonComponent } from 'jqwidgets-ng/jqxswitchbutton';
@Component({
selector: 'app-root',
imports: [jqxSwitchButtonModule],
template: ` <jqxSwitchButton #mySwitchButton [width]="81" [height]="27"> </jqxSwitchButton> `
})
export class App implements AfterViewInit {
readonly mySwitchButton = viewChild.required<jqxSwitchButtonComponent>('mySwitchButton');
ngAfterViewInit(): void {
this.mySwitchButton().check();
}
}
|
|
disable
# |
Void
|
None
|
import { Component, AfterViewInit, viewChild } from '@angular/core';
import { jqxSwitchButtonModule, jqxSwitchButtonComponent } from 'jqwidgets-ng/jqxswitchbutton';
@Component({
selector: 'app-root',
imports: [jqxSwitchButtonModule],
template: ` <jqxSwitchButton #mySwitchButton [width]="81" [height]="27"> </jqxSwitchButton> `
})
export class App implements AfterViewInit {
readonly mySwitchButton = viewChild.required<jqxSwitchButtonComponent>('mySwitchButton');
ngAfterViewInit(): void {
this.mySwitchButton().disable();
}
}
|
|
enable
# |
Void
|
None
|
import { Component, AfterViewInit, viewChild } from '@angular/core';
import { jqxSwitchButtonModule, jqxSwitchButtonComponent } from 'jqwidgets-ng/jqxswitchbutton';
@Component({
selector: 'app-root',
imports: [jqxSwitchButtonModule],
template: ` <jqxSwitchButton #mySwitchButton [width]="81" [height]="27"> </jqxSwitchButton> `
})
export class App implements AfterViewInit {
readonly mySwitchButton = viewChild.required<jqxSwitchButtonComponent>('mySwitchButton');
ngAfterViewInit(): void {
this.mySwitchButton().enable();
}
}
|
|
toggle
# |
Void
|
None
|
import { Component, AfterViewInit, viewChild } from '@angular/core';
import { jqxSwitchButtonModule, jqxSwitchButtonComponent } from 'jqwidgets-ng/jqxswitchbutton';
@Component({
selector: 'app-root',
imports: [jqxSwitchButtonModule],
template: ` <jqxSwitchButton #mySwitchButton [width]="81" [height]="27"> </jqxSwitchButton> `
})
export class App implements AfterViewInit {
readonly mySwitchButton = viewChild.required<jqxSwitchButtonComponent>('mySwitchButton');
ngAfterViewInit(): void {
this.mySwitchButton().toggle();
}
}
|
|
uncheck
# |
Void
|
None
|
import { Component, AfterViewInit, viewChild } from '@angular/core';
import { jqxSwitchButtonModule, jqxSwitchButtonComponent } from 'jqwidgets-ng/jqxswitchbutton';
@Component({
selector: 'app-root',
imports: [jqxSwitchButtonModule],
template: ` <jqxSwitchButton #mySwitchButton [width]="81" [height]="27"> </jqxSwitchButton> `
})
export class App implements AfterViewInit {
readonly mySwitchButton = viewChild.required<jqxSwitchButtonComponent>('mySwitchButton');
ngAfterViewInit(): void {
this.mySwitchButton().uncheck();
}
}
|
|
val
# |
Boolean
|
value: Boolean
|
import { Component, AfterViewInit, viewChild } from '@angular/core';
import { jqxSwitchButtonModule, jqxSwitchButtonComponent } from 'jqwidgets-ng/jqxswitchbutton';
@Component({
selector: 'app-root',
imports: [jqxSwitchButtonModule],
template: ` <jqxSwitchButton #mySwitchButton [width]="81" [height]="27"> </jqxSwitchButton> `
})
export class App implements AfterViewInit {
readonly mySwitchButton = viewChild.required<jqxSwitchButtonComponent>('mySwitchButton');
ngAfterViewInit(): void {
let value = this.mySwitchButton().val();
}
}
|