Enforce/limit single select on dropdownlist MultiSelectModeTypes.VisualMode

Hi,

We'd like to make use of the visual mode for selecting items in the dropdownlist as it's much simplier to remove/unselect items. However, we only want to allow for one item to be selected at a time though. 

Important note: we are enabling persistence (enablePersistence: true)

This example gives us similar behavior, but persistence stops working as expected:

We'd also like the user to be able to select a different item from the dropdownlist and the selected item should then change to the newly selected item.

There doesn't seem to be a clean way of clearing the current selection - why is this?

1 Reply

SA Shameer Ali Baig Sulaiman Ali Baig Syncfusion Team April 21, 2020 01:51 PM UTC

Hi Malcolm, 
 
Greetings from Syncfusion support. 
 
We have checked with your query on EJ DropDownList component. We can achieve your expected requirement by updating the value property in the change event of the DropDownList component. Please, check out the following sample which meets your expected requirement. 
 
change: function(args){ 
                        if(this.model.selectedIndices.length>1){ 
                        this.clearText(); 
                        this.option("value", args.selectedValue); 
              } 
 
Please, let us know if you need any further assistance. 
 
Regards, 
Shameer Ali Baig S. 


Loader.
Up arrow icon