is it possible to add a key/value pair array for datasource for DropDownList
The guide here shows how to add a value/array as the datasource.
<input id="dropdownlist" />
<script>
$("#dropdownlist").kendoDropDownList({
dataSource: {
data: ["One", "Two"]
}
});
</script>
However I need something like this. i.e a key/value pair.
i.e I need to display the key in the dropdown but return the value if the dropdown is selected.
<input id="dropdownlist" /><script>
$("#dropdownlist").kendoDropDownList({
dataSource: {
data: [{email: 'one'} , {email: 'Two'}],
dataTextFiled: "email",
dataValueField: "email"
}
});
</script>
