How to add custom attribute to kendo combobox

5k views Asked by At

I am working on web application using kendo UI and I need to add a custom attribute to combobox.

How can I do this?

1

There are 1 answers

2
Nic On BEST ANSWER

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