如何将自定义属性添加到kendo组合框

时间:2015-06-25 04:07:44

标签: javascript jquery kendo-ui kendo-combobox

我正在使用kendo UI处理Web应用程序,我需要为组合框添加自定义属性。

我该怎么做?

1 个答案:

答案 0 :(得分:5)

您可以use 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");
};

这将导致:

Attr

相关问题