Primeng 多重选择未检测到更改值

问题描述 投票:0回答:2

*> > > ***

>     
>         1. my component :    
>                 onClose()
>                {  this.selectedWorkCenterData.forEach(data =>{
>     
>     >             this.selectedWorkCenterValue.push(data);
>     >           }) } 
>               on Row Select the data  
>     
>     ***
>     
>     > Blockquote
>     
>     ***on selection of rows from prime ng table to populate in multi select
>     
>     onRowSelect(event) {
>     >         this.selectedWorkCenterValue = [];
>     >         if (event.data["WORK_CENTER_ID"]) {
>     >           this.selectedWorkCenterData.push(event.data);
>     >           this.searchOnWorkCenters();
>     >         }


 my html: <p-multiSelect
>     >             [options]="selectedWorkCenterData"
>     >             maxSelectedLabels="10"
>     >             [(ngModel)]="selectedWorkCenterValue"
>     >             [style]="{ width: '100%' }"
>     >             optionLabel="{{ lookup_config }}"
>     >             defaultLabel="Choose Work Center"
>     >             (onChange)="choosenWorkCenters()"
>     >             #mySelect

块引用

>     

我必须在我的项目中做:在更改多选选项时, dropdon 没有更新值。请帮助解决这个问题。*

angular6 primeng
2个回答
0
投票

尝试一下(在每次更改推送中,删除例如);

this.selectedWorkCenterValue = new Array<any>();

0
投票

我发布了类似问题的答案。希望这可以帮助解决此问题的任何人:https://stackoverflow.com/a/78219288/4983912

© www.soinside.com 2019 - 2024. All rights reserved.