How get selected items

Could i have a small example on how to get the list of selected items using the 'multiselect' component?
I tried to implement the example defined in Thread ID: 148142 (which I report below),
but, when I press the button, the result of the console.log () is always 'undefined'

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);
}

3 Replies 1 reply marked as answer

BC Berly Christopher Syncfusion Team October 23, 2020 12:45 PM UTC

Hi Alfredo, 
  
Greetings from Syncfusion support. 
  
We have checked the MultiSelect component based on the provided code example. When we select the values in the MultiSelect and clicking the button, we can get the selected value correctly from the component instance. Please find the screenshot and sample from below. 
  
  
 
 
  
So, we suggest you to ensure that MultiSelect component instance is created correctly inside the external button click event. Still the issue persists, please share the issue reproducing sample and Syncfusion product version that will help us to check and proceed further at our end. 
  
Regards, 
Berly B.C 


Marked as answer

AL Alfredo October 29, 2020 08:10 AM UTC

OK!
Many thanks for your cooperation


BC Berly Christopher Syncfusion Team October 30, 2020 02:55 PM UTC

Hi Alfredo, 
  
Most welcome. Please let us know if you need further assistance on this. 
  
Regards, 
Berly B.C 


Loader.
Up arrow icon