我想使用Jquery动态创建Kendo Dropdown。我需要在Jquery中创建所有内容。 我使用下面的代码,但它只创建输入文本框,但不转换为DDl。
var kendoddl = $("<input id=color value=1 />");
$("#color").kendoDropDownList({
dataTextField: action.Name,
dataValueField: action.Name,
dataSource: action,
index: 0
});
$("#addconfigurations").append(kendoddl);
答案 0 :(得分:3)
重新排序代码。首先添加append然后添加调用kendoDropDownList
var kendoddl = $("<input id=color value=1 />");
$("#addconfigurations").append(kendoddl);
$("#color").kendoDropDownList({
dataTextField: action.Name,
dataValueField: action.Name,
dataSource: action,
index: 0
});