kendo-ddlinsanity
HTML
<link rel="stylesheet" href="http://cdn.kendostatic.com/2013.3.1324/styles/kendo.common.min.css">
<link rel="stylesheet" href="http://cdn.kendostatic.com/2013.3.1324/styles/kendo.default.min.css">
<script src="http://cdn.kendostatic.com/2013.3.1324/js/kendo.all.min.js"></script>
<select id="dropdownlist">
<option value="1">Item 1</option>
<option value="2">Item 2</option>
</select>
JavaScript
$(function () {
var items = [
{ text: 'Item 3', value: '3' },
{ text: 'Item 4', value: '4' }
];
var dropDownListEl = $('#dropdownlist');
dropDownListEl.kendoDropDownList({
dataTextField: 'text',
dataValueField: 'value',
index: 0
});
var kDropDownList = dropDownListEl.data('kendoDropDownList'),
ds = kDropDownList.dataSource;
items.forEach(function (item) {
ds.add(item);
});
kDropDownList.bind('select', function (e) {
var dataItem = this.dataItem(e.item.index());
console.log('this.value(): ' + dataItem.value);
});
});