Toolkit
TK.ButtonSwitcher
Button switcher component
{
Elements: {
Switcher: {
_: TK.ButtonSwitcher,
Multiple: false,
Options: [
{ Text: "A", Value: 1, Title: "Some title text", Image: null },
{ Text: "B", Value: 2 },
{ Text: "C", Value: 3 }
],
onchange: function() {
this.Sibling.Status.innerText = "Value is " + this.GetValue();
}
},
Status: {
}
}
}
Button switcher in form
{
_: TK.Form,
Model: {
TestField: [2,3]
},
Fields: {
TestField: {
Type: "buttonSwitcher",
Multiple: true,
Options: [
{ Text: "A", Value: 1 },
{ Text: "B", Value: 2 },
{ Text: "C", Value: 3 }
]
}
},
Save: function(model) {
alert("Value is " + model.TestField);
}
}