What is the best way to get the count of selected Items in the Kendo multi select control?
I've tried:
multiSelect.dataItems().count()
and
multiSelect.value().count()
and neither work? Any suggestions would be greatly appreciated.
using multiSelect.value() will give you an array of the selected items. You can then get the .length off the array:
var count = multiSelect.value().length;
http://docs.kendoui.com/api/web/multiselect#methods-value
and
https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/length
It might help to others
var multiSelectItems = $('#MultiselectCollection').data('kendoMultiSelect');
var count = multiSelectItems .value().length;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With