灌注多重选择未检测到变化值

时间:2019-01-31 17:38:41

标签: angular6 primeng

*>>> ***

  
>     
>         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
         

Blockquote

  
     

     
>     
         

我必须在我的项目中执行以下操作:从multi select中更改选项时,没有dropdon的更新值。请帮助解决此问题。*

  

1 个答案:

答案 0 :(得分:0)

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

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