select
Gets or sets the selected value. If called without arguments, returns the currently selected value. If called with a value, selects the item with the matching value.
Parameters
value String (optional)
The value of the item to select. If omitted, the method returns the currently selected value.
Returns
String the selected value when used as a getter.
Example - select an item
<div id="segmentedControl"></div>
<script>
$("#segmentedControl").kendoSegmentedControl({
selectedValue: "option1",
items: [
{ text: "Option 1", value: "option1" },
{ text: "Option 2", value: "option2" }
]
});
var segmentedControl = $("#segmentedControl").data("kendoSegmentedControl");
segmentedControl.select("option2");
</script>
Example - get the selected value
<div id="segmentedControl"></div>
<script>
$("#segmentedControl").kendoSegmentedControl({
selectedValue: "option1",
items: [
{ text: "Option 1", value: "option1" },
{ text: "Option 2", value: "option2" }
]
});
var segmentedControl = $("#segmentedControl").data("kendoSegmentedControl");
var selected = segmentedControl.select();
/* The result can be observed in the DevTools(F12) console of the browser. */
console.log(selected);
</script>