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

Reuse existing datasource; Rebinding a dropdownlist

0 Answers 211 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
Joey Cruz
Top achievements
Rank 1
Joey Cruz asked on 10 Jan 2012, 11:18 PM
I have created a datasource (verified the results retrieved) then I try to use it when initializing a dropdownlist. The dropdown list is rendered but not populated with any data. Also how do I refresh the dropdown after the datasource results have changed? I realize that I can't reinitialize the original element multiple times. Thanks!

Sample Code:

var myDataSource = new kendo.data.DataSource({
transport: {
  read: {
   url: '@Url.Action("Method", "Entity", new { Area = "Area" })',
   dataType: "json",
   contentType: "application/json; charset=utf-8",
   data: { param1: param }
  }
 },
 change: function (event) {
  $("#INPUT").kendoDropDownList({
       dataTextField: "Text",
       dataValueField: "Value",
       dataSource:
              {
              data: myDataSource 
              }
        }
   });

No answers yet. Maybe you can help?

Tags
DropDownList
Asked by
Joey Cruz
Top achievements
Rank 1
Share this question
or