# Update MVVM-Bound Models on Loading the DropDownList

## Environment

<table>
 <tr>
  <td>Product</td>
  <td>Progress® Kendo UI® DropDownList for jQuery</td>
 </tr>
 <tr>
  <td>Operating System</td>
  <td>Windows 10 64bit</td>
 </tr>
 <tr>
  <td>Visual Studio Version</td>
  <td>Visual Studio 2017</td>
 </tr>
 <tr>
  <td>Preferred Language</td>
  <td>JavaScript</td>
 </tr>
</table>

## Description

How can I update an MVVM-bound model on load in a Kendo UI DropDownList?

## Solution

The following example demonstrates how to achieve the desired scenario.

```dojo
  <div id="example">
    <div class="demo-section k-header">

      <div class="box-col">
        <h4>Choose a product e.g. 'Chai'</h4>
        <input data-role="dropdownlist"
               data-auto-bind="false"
               data-bound="updateModel"
               data-text-field="ProductName"
               data-value-field="ProductID"
               data-bind="value: selectedProduct,
                          source: products,
                          events: {
                          change: onChange,
                          open: onOpen,
                          close: onClose
                          }"
               style="width: 300px"
               /><button data-bind="click: onChange">click for selected value</button>
      </div>
      <div class="box-col console-section">
        <h4>Console</h4>
        <div class="console"></div>
      </div>
    </div>

    <script>
      function updateModel(e) {
        var widget = e.sender;

        setTimeout(function() {
          widget.trigger("change");
        });
      };

      var viewModel = kendo.observable({
        selectedProduct: null,
        displaySelectedProduct: function() {
          var selectedProduct = this.get("selectedProduct");
          return kendo.stringify(selectedProduct, null, 4);
        },
        onOpen: function() {
          $(".console").append("<p>event :: open</p>");
        },
        onChange: function() {
          $(".console").append("<p>event :: change (" + this.displaySelectedProduct() + ")</p>");
        },
        onClose: function() {
          $(".console").append("<p>event :: close</p>");
        },
        products: [{ProductName: "test title", ProductID: "1"}]
      });
      kendo.bind($("#example"), viewModel);
    </script>
  </div>
```

## See Also

* [JavaScript API Reference of the DropDownList](https://www.telerik.com/kendo-jquery-ui/documentation/api/ui/dropdownlist)
* [Automatically Adjust the Width of a DropDownList](https://www.telerik.com/kendo-jquery-ui/documentation/knowledge-base/auto-adjust-the-width)
* [Create DropDownLists with Long Items](https://www.telerik.com/kendo-jquery-ui/documentation/knowledge-base/create-dropdownlist-with-long-items)
* [Detect Wrapper Focus Events](https://www.telerik.com/kendo-jquery-ui/documentation/knowledge-base/detect-wrapper-focus-event)
* [Move the Group Label on Top of Items](https://www.telerik.com/kendo-jquery-ui/documentation/knowledge-base/group-label-on-top-of-the-items)
* [Prevent Popup Closure on Scroll](https://www.telerik.com/kendo-jquery-ui/documentation/knowledge-base/prevent-close-on-scroll)
* [Remove Items](https://www.telerik.com/kendo-jquery-ui/documentation/knowledge-base/remove-items)
* [Set DataSource Dynamically](https://www.telerik.com/kendo-jquery-ui/documentation/knowledge-base/set-datasource-dynamically)
