user3194721
user3194721

Reputation: 815

Jquery & KendoUI dropdown create dynamically

I want create Kendo Dropdown dynamically using Jquery. I need to created everything in Jquery. I've used below code, but it is creating only input textbox, but not converting into DDl.

var kendoddl = $("<input id=color value=1 />");

                   $("#color").kendoDropDownList({
                       dataTextField: action.Name,
                       dataValueField: action.Name,
                       dataSource: action,
                       index: 0
                   });

                   $("#addconfigurations").append(kendoddl);

Upvotes: 2

Views: 4135

Answers (1)

dm4web
dm4web

Reputation: 4652

Reorder your code. First add append and then add call kendoDropDownList

var kendoddl = $("<input id=color value=1 />");

$("#addconfigurations").append(kendoddl);

$("#color").kendoDropDownList({
      dataTextField: action.Name,
      dataValueField: action.Name,
      dataSource: action,
      index: 0
});

http://dojo.telerik.com/azOJ

Upvotes: 3

Related Questions