我正在使用该库的多选选项,我的复选框上面有一个,需要选中所有复选框,而用户单击“全选”复选框,如何执行此操作,任何人以前都已实现。 https://github.com/softsimon/angular-2-dropdown-multiselect
答案 0 :(得分:0)
尝试一下:
设置:
mySettings: IMultiSelectSettings = {
enableSearch: false,
showCheckAll: true,
showUncheckAll: true,
checkedStyle: 'checkboxes',
autoUnselect: true,
containerClasses: 'displayBlock',
dynamicTitleMaxItems: 3,
displayAllSelectedText: true
};
显示文字:
myTexts: IMultiSelectTexts = {
checkAll: 'Select all',
uncheckAll: 'Unselect all',
}
HTML:
<ss-multiselect-dropdown [(ngModel)]="optionsModel" [options]="myOptions" [texts]="myTexts" [settings]="mySettings" (ngModelChange)="onChange($event)"></ss-multiselect-dropdown>