the OnSelectAll is called when you select an option, you need to create onItemDeSelect function in your typescript file
and use this HTML :
<ng-multiselect-dropdown-angular7 [placeholder]="'custom placeholder' [data]="dropdownList" [(ngModel)]="selectedItems" [settings]="dropdownSettings" (onSelect)="onItemSelect($event)" (onSelectAll)="onSelectAll($event)" (onDeSelect)="onItemDeSelect($event)"> </ng-multiselect-dropdown-angular7>
Here is my code
In HTML
<ng-multiselect-dropdown class=""
placeholder="Select value"
[data]="dropdownData"
[settings]="dropdownSettings"
(onSelect)="onItemSelect($event)"
(onSelectAll)="onSelectAll($event)"
(onDeSelect)="onItemDeSelect($event)"
(onDeSelectAll)="onDeSelectAll($event)">
</ng-multiselect-dropdown>
then in xxx.component.ts file
onDeSelectAll(items: any){
//here you have access to all items
}
Define the Event in the Component like this
onItemDeSelect(item: any) {
console.log('onItemDeSelect', item);
}
and use onDeSelect on the View like this
<ng-multiselect-dropdown-angular7 ... (onDeSelect)="onItemDeSelect($event)"></ng-multiselect-dropdown-angular7>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.