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. Image for the cookie policy date

Get selected values from multiselect checkbox

Hi, I am following this example - https://ej2.syncfusion.com/angular/demos/?_ga=2.203148561.1665470057.1569768206-867896921.1564449587#/material/multi-select/checkbox

I am looking for a way to get an array with all the selected Ids for the items that were checked(selected) from a multiselect dropdown component, upon a button click event. 




1 Reply

VK Vinoth Kumar Sundara Moorthy Syncfusion Team October 8, 2019 09:22 AM UTC

Hi Jose, 
 
Thank you for contacting Syncfusion support. 
 
We have checked your requirement “Get selected values from multiselect checkbox” and it can be achieved using value property based on applied filed settings. You can also get the popup display value using text property. Please check the below code snippet, 
 
app.component.html 
<ejs-multiselect id='multiselect-checkbox' #checkbox [dataSource]='countries' [placeholder]='checkWaterMark' [fields]='checkFields' 
                    [mode]='mode' [popupHeight]='popHeight' [showDropDownIcon]='true' showSelectAll='true' [filterBarPlaceholder]='filterPlaceholder'></ejs-multiselect> 
<button (click)="btnclick()">Get Selected Value</button> 
 
app.component.ts 
import { MultiSelectComponent } from '@syncfusion/ej2-angular-dropdowns'; 
 
@ViewChild('checkbox', {static: true}) 
public mulObj: MultiSelectComponent; 
 
btnclick() {  
    console.log(this.mulObj.value); 
} 
 
 
Could you please check the above sample and get back to us if you need any further assistance on this? 
 
Regards, 
Vinoth Kumar S 


Loader.
Live Chat Icon For mobile
Up arrow icon