user2176191
user2176191

Reputation: 49

How to add custom attribute to kendo combobox

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

Answers (1)

Nic
Nic

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:

Attr

Upvotes: 5

Related Questions