We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Multiselect dropdown - Don't open dropdown on chip selection event.

Thread ID:

Created:

Updated:

Platform:

Replies:

146761 Aug 19,2019 12:00 AM UTC Aug 21,2019 05:50 AM UTC ASP.NET Core - EJ 2 3
loading
Tags: MultiSelect Dropdown
Jesse
Asked On August 19, 2019 12:00 AM UTC

I have a multiselect control on my page and am using the chipSelection to toggle the chip color.
The color is correctly toggled when a user clicks on a chip, but the issue is the dropdown box opening as well when this happens.
Is there a way prevent the dropdown box from opening if the click occurs on a chip?

<ejs-multiselect
     ...
     chipSelection="onSelection"
     ...
 </ejs-multiselect>

<script>
function onSelection(e) {
     $(e.currentTarget).toggleClass("selected")
}
</script>

<style>
    .e-chips.selected {
        background-color: #3848BF !important;
    }
</style>

Vinoth Kumar Sundara Moorthy [Syncfusion]
Replied On August 20, 2019 05:01 PM UTC

Hi Jesse, 
 
Good day to you. 
 
We have checked your requirement and restricted opening the popup while performing chip selection in the open event. Please refer the below code example, 
 
Code Example 
<ejs-multiselect id="local" placeholder="Select games" dataSource="@ViewBag.data" chipSelection="onSelection" open="onOpen"> 
    <e-multiselect-fields text="Game" value="Id"></e-multiselect-fields> 
</ejs-multiselect> 
 
<script> 
    var isSelection = false; 
    function onSelection(e) { 
        $(e.currentTarget).toggleClass("selected"); 
        isSelection = true; 
    } 
    function onOpen(args) { 
        if (isSelection) { 
            args.cancel = true; 
            isSelection = false; 
        } 
    } 
</script> 
 
For your convenience, we have prepared the sample and same can be found in below link, 
 
Could you please check the above sample and get back to us if you need any further assistance? 
 
Regards, 
Vinoth Kumar S 


Jesse
Replied On August 21, 2019 12:33 AM UTC

You are a champion Vinoth!!

Thanks heaps, keep up the good work :)

Vinoth Kumar Sundara Moorthy [Syncfusion]
Replied On August 21, 2019 05:50 AM UTC

Hi Jesse, 
  
Thank you for the appreciation. Please feel free to contact us if you need any further assistance on Syncfusion components. 
  
Regards, 
Vinoth Kumar S 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon