Reputation: 49
I am working on web application using kendo UI and I need to add a custom attribute to combobox.
How can I do this?
Upvotes: 3
Views: 5222
Reputation: 12855
You can use JQuery to set an attribute:
Example:
<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");
};
This will result in:
Upvotes: 5