我正在使用剑道 UI 开发 Web 应用程序,我需要向组合框添加自定义属性。
我怎样才能做到这一点?
您可以使用 JQuery设置属性:
例子:
<input id="combobox" style="width: 100%"/>
$("#combobox").kendoComboBox({
dataTextField: "text",
dataValueField: "value",
filter: "startswith",
dataSource: data,
dataBound: onDataBound
});
function onDataBound(e) {
$("#combobox").closest(".k-combobox").attr("someAttr", "someValue");
};
这将导致: