Is there any way to restrict a multiselect to only having one selection, and then no more can be made. I tried playing with the changed event, and checking for the number of values, and if more than zero, disabling the control, but then it wasn't possible to remove the selection, and add a new one.
multiChanged:
function
(e) {
var
values = e.sender.value();
if
(values.length > 0) {
viewModel.set(
"available"
,
false
);
}
}
So I switched to using the select event, checking the value for more than zero.
selected:
function
(e) {
if
(viewModel.selectedNames.length > 0) {
e.preventDefault();
}
},
This seems to work, but am more wondering if there is something built-in to the multiselect so I wouldn't have to use the events.
Here is my semi-working sample
Demo@TryKendoUI