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

deselect chips programmatically in chiplist

Thread ID:

Created:

Updated:

Platform:

Replies:

145098 Jun 6,2019 01:32 PM UTC Jun 10,2019 12:27 PM UTC Angular - EJ 2 3
loading
Tags: Chip
ttArbor
Asked On June 6, 2019 01:32 PM UTC

is there some way I can deselect a selected chip dynamically in the code  in a chiplist with multiple selection? 

Thanks


Christopher Issac Sunder K [Syncfusion]
Replied On June 7, 2019 01:30 PM UTC

Hi thao, 

Greetings from Syncfusion support. 

We have achieved your requirement by selecting the item again using select method. That helps you to deselect a selected item. 

this.chip.select(3); 

We have created a sample for deselecting a selected item. Please refer the sample link given below 


Please get back to us if you require any further assistance. 

Thanks,
Christo 


ttArbor
Replied On June 7, 2019 02:48 PM UTC

I've tried that but it doesn't really turn out as expected. From what I see is   'select' method pretty much toggling the chip. 

For example: if there are [1,2,3] selected. Calling  this.chip.select(3) will deselect [3] , which is not something expected.  


Christopher Issac Sunder K [Syncfusion]
Replied On June 10, 2019 12:27 PM UTC

Hi thao, 

Thanks for the update. 

When you want to deselect an entire selected chip, we need to pass the selected chips index position to chips “select” method. Please refer the code snippets given below. 

this.chipIndex = this.chip.element.ej2_instances[0].getSelectedChips().Indexes; 
this.chip.select(this.chipIndex); 

please refer the online sample given below. 

Please get back to us if you require any further assistance. 

Thanks,
Christo 


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