This is a migrated thread and some comments may be shown as answers.

Minimum selected items

1 Answer 202 Views
MultiSelect
This is a migrated thread and some comments may be shown as answers.
Scott
Top achievements
Rank 1
Scott asked on 19 Mar 2015, 09:36 PM
I'm wondering if it's possible to enforce a minimum number of selections in a multiselect widget. I'd like to prevent the user from removing all items from the list, requiring at least one for validity. I see that there's a maxSelectedItems option, but there doesn't appear to be a minSelectedItems. I played with the select and change event hooks, but select doesn't seem to fire on removal and change fires after the item has been removed from the list.

Is there another way I could go about this?

1 Answer, 1 is accepted

Sort by
0
Kiril Nikolov
Telerik team
answered on 21 Mar 2015, 12:49 PM

Hello Scott,

You can use the change event of the widget, and if you detect that the last item is getting removed, you can just add the default item that you want to see there. Here is an example that you can use as a base reference:

http://dojo.telerik.com/ONOWU

Regards,
Kiril Nikolov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
MultiSelect
Asked by
Scott
Top achievements
Rank 1
Answers by
Kiril Nikolov
Telerik team
Share this question
or