Uncheck item in Multiselect by button click

Hi,


Is there a way to deselect an item in the Multiselect popup by a button that is outside of the Multiselect control?


Scenario:

I have a multiselect that has 6 items within it, each of these items shows a specific div for each item when selected. In the divs I have a close button that hides that div and I want to also deselect the selected checkbox in the multiselect.


1 Reply

SP Sureshkumar P Syncfusion Team February 24, 2022 11:08 AM UTC

Hi Glen, 
 
You can achieve your requirement by set the value property as like below code example. 
 
Find the code example: 
[component.html] 
  <button (click)="onClick($event)">Clicktodeselect Mexico</button> 
        <h4>Multiselect</h4> 
        <ejs-multiselect #multiselect id="multiselect" [value]="multiVal" [dataSource]="data" [fields]="fields" 
            [placeholder]="watermarks"></ejs-multiselect> 
 
[component.ts] 
 
public onClick = (e: FilteringEventArgs) => { 
    this.listObj.value = ['JP']; 
  }; 
 
 
 
 
Regards, 
Sureshkumar P 


Loader.
Up arrow icon