Rohan Rohan - 1 year ago 123
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


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() );