This is a migrated thread and some comments may be shown as answers.

How to select value from view model?

0 Answers 62 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Eric
Top achievements
Rank 1
Eric asked on 30 Aug 2012, 08:50 PM
I have a kendo combobox that I'm populating from a remote json call.  I'm also binding a json object to dom elements.  Is there a way to bind the selected value of the combobox with the id returned from the json \ viewmodel object?  Thanks

<input type="hidden" data-bind="value:Id" /><br />
         <input type="text" placeholder="First name" name="FirstName" maxlength="30" data-bind="value:FirstName" id="id_firstName" /><br />
         <input type="text" placeholder="Last name" name="LastName" maxlength="30" data-bind="value:LastName" id="id_lastName" /><br />
         <input type="text" placeholder="Email" name="email" maxlength="30" data-bind="value:Email" id="id_email" /><br />
         <input id="timeZones">
         <button data-bind="click: save" class="btn">Save</button>

$("#timeZones").kendoComboBox({
              index: 0,
              placeholder: "Select Time Zone",
              dataTextField: "DisplayName",
              dataValueField: "Id",
              filter: "contains",
              dataSource: {
                  type: "json",
                  transport: {
                      read: "/api/TimeZone/Get/"
                  }
              }
          });

No answers yet. Maybe you can help?

Tags
ComboBox
Asked by
Eric
Top achievements
Rank 1
Share this question
or