dataValueField String
(default: "")
The field of the data item that provides the value of the widget.
If you define the
dataValueField
option, you also have to setdataTextField
.
Example - set the dataValueField
<select id="listBox"></select>
<script>
$("#listBox").kendoListBox({
dataSource: [
{ name: "Item 1", id: 1 },
{ name: "Item 2", id: 2 }
],
dataTextField: "name",
dataValueField: "id"
});
</script>