change
Fires when the user changes a button selection in the SegmentedControl.
The event handler function context (available via the this keyword) will be set to the widget instance.
Event Data
e.item Object
The item data object of the selected button.
e.value String
The value of the selected button.
e.preventDefault Function
If invoked, prevents the selection change.
e.sender kendo.ui.SegmentedControl
The widget instance which fired the event.
Example - subscribe to the "change" event during initialization
<div id="segmentedControl"></div>
<script>
$("#segmentedControl").kendoSegmentedControl({
items: [
{ text: "Option 1", value: "option1" },
{ text: "Option 2", value: "option2" },
{ text: "Option 3", value: "option3" }
],
change: function(e) {
/* The result can be observed in the DevTools(F12) console of the browser. */
console.log(e.value);
}
});
</script>
Example - subscribe to the "change" event after initialization
<div id="segmentedControl"></div>
<script>
$("#segmentedControl").kendoSegmentedControl({
items: [
{ text: "Option 1", value: "option1" },
{ text: "Option 2", value: "option2" },
{ text: "Option 3", value: "option3" }
]
});
var segmentedControl = $("#segmentedControl").data("kendoSegmentedControl");
segmentedControl.bind("change", function(e) {
/* The result can be observed in the DevTools(F12) console of the browser. */
console.log(e.item);
});
</script>