Reuse existing datasource; Rebinding a dropdownlist

1 posts, 0 answers
  1. Joey Cruz
    Joey Cruz avatar
    1 posts
    Member since:
    Sep 2005

    Posted 10 Jan 2012 Link to this post

    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 
                  }
            }
       });
Back to Top