Knockout kendo dropdown

http://stackoverflow.com/questions/12051943/refresh-kendodropdown-using-knockout-kendo-js-library

by Gabriel Tran

HTML

<script src="http://knockoutjs.com/downloads/knockout-2.0.0.debug.js"></script>
<link rel="stylesheet" href="http://rniemeyer.github.com/knockout-kendo/css/kendo.common.min.css">
<link rel="stylesheet" href="http://rniemeyer.github.com/knockout-kendo/css/kendo.default.min.css">
<script src="http://cdn.kendostatic.com/2012.1.322/js/kendo.all.min.js"></script>
<script src="http://rniemeyer.github.com/knockout-kendo/js/knockout-kendo.min.js"></script>
<input data-bind="kendoAutoComplete: { dataTextField: 'name', dataValueField:'id', data: choices,select: function(e) { 
        $data.selectedChoice(this.dataItem(e.item.index()).id);
    } }" />
<hr/>
Selected: <strong data-bind="text: selectedChoice"> </strong>

JavaScript

var ViewModel = function() {
    this.choices = ko.observableArray([
        { id: "1", name: "apple"},
        { id: "2", name: "orange"},
        { id: "3", name: "banana"}
    ]);
    this.selectedChoice = ko.observable();   
};

ko.applyBindings(new ViewModel());