angular2-multiselect-下拉onAddFilterNewItem不起作用

时间:2019-01-09 07:33:34

标签: typescript angular6 multi-select

嗨,我是angular 6的新手,我使用angular2-multiselect-dropdown,但问题是onAddFilterNewItem无法正常工作。

多选链接-https://cuppalabs.github.io/angular2-multiselect-dropdown/#/searchfilterAddNewItem

我试图添加设置和提供的html标签

HTML

<angular2-multiselect style="width: 100%" class="border-bot-none" 
name="businessImpact"
[data]="businessImpactList" [(ngModel)]="selectedbusinessImpactItems" 
[settings]="businessImpactdropdownSettings"
(onSelect)="onItemSelect($event)" (onDeSelect)="OnItemDeSelect($event)" 
(onSelectAll)="onSelectAll($event)"
(onDeSelectAll)="onDeSelectAll($event)" 
(onAddFilterNewItem)="onAddItem($event)" required>
</angular2-multiselect>

.ts(多选下拉菜单设置)

this.businessImpactdropdownSettings = {
singleSelection: true,
text: 'Select Business Impact',
classes: 'custom-class-example',
primaryKey: 'impactStatement',
labelKey: 'impactStatement',
enableSearchFilter: true,
addNewItemOnFilter: true,
searchBy: ['impactStatement']
};

onAddItem(data: string) {
console.log(data);
}

0 个答案:

没有答案