PhotonUI logo

PhotonUI

A javascript framework to create user interfaces

Switch

Class Reference

More examples

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
var grid = new photonui.GridLayout({
children: [
new photonui.Switch({
name: "switch1",
value: true,
layoutOptions: {
gridX: 1,
gridY: 0
},
callbacks: {
"value-changed": function(widget, value) {
alert(widget.name + " = " + value);
}
}
}),
new photonui.Label({
text: "Switch:",
forInputName: "switch1",
layoutOptions: {
gridX: 0,
gridY: 0
}
})
]
});

photonui.domInsert(grid, "demo");