ckyycc / ngx-dropdown-list

Drop-down list which supports multi-selection and filter (Angular)
https://ckyycc.github.io/ngx-dropdown-list/
MIT License
4 stars 3 forks source link

How to set selected values as checked in mulpltipleselctions dropw down #3

Open Indrani123 opened 4 years ago

Indrani123 commented 4 years ago

I have below sample code to try to using the ngx drop down as multiple selection. I have use case to loaded already selected value, but for using multiple selection is not happening

<ngx-dropdown-list #dropDown [items]="items" [multiSelection]="true" [selectedValue]="selectedValues" [placeHolder]="placeholderLabel" (selectionChange)="onChange(items)">

where selected values is the list of selected items with selected as true,but checkMark css is not set to checked, when i load this component with have selected values

rajpateln1995 commented 4 years ago

Add a key value pair to your items array as below items = [ { id: '', value : '', text : '', selected : true } ]