Rohan Rohan - 2 years ago 313
HTML Question

Kendo multiselect

All the example and uses of Kendo UI Multiselect I've seen so far use 'id' instead of 'class' name in the html

I tried using class name but it doesn't seem to work. Am I doing something wrong or Kendo doesn't support this?


<select class="multiselect" kendo-multi-select k-options="selectOptions">


const multiselect = $(".multiselect").data("kendoMultiSelect");
const value = multiselect.value();

This is the error I get:

TypeError: Cannot read property 'value' of undefined

Answer Source

You will need to use a more specific selector because the controls are wrapped.

var mymultiselect = $(".multiselect[data-role=multiselect]");

mymultiselect.each(function(idx, input) {
     var myselect= $(input).data("kendoMultiSelect");

     alert("Value: " + myselect.value() );
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download