How to loop to all multi drop down list and get selected text from all drop down list

4 views
Skip to first unread message

ahmed elbarbary

unread,
May 16, 2020, 3:39:07 PM5/16/20
to Angular and AngularJS discussion


work on angular 7 I need when have multi select drop down listI

loop on onchangeevent and get all selected text separated by and as (dropdown1 text and dropdown2 text).

Now code below get select text for only one drop down on this line

let collectdatamultidropdown:any="statusdata + "=" + textdata"
Expected result if multi drop down will be as below

for ()
{
}

let collectdatamultidropdown:any="statusdata + "=" + textdata"
and "statusdata + "=" + textdata"

code below

onChange
($event)  
 
{  
    let textdata
=$event.target.options[$event.target.options.selectedIndex].text;  
    let statusdata
:any = this.FilterBinddata.filter(s=>s.reportSource==textdata)[0].reportSource2;  
    let collectdatamultidropdown
:any="statusdata + "=" + textdata"
}  


<div class="form-group" style="display: flex; align-items: center;margin-top:10px;margin-left:20px;">  
         
<div *ngFor="let fil of FilterList"  style="padding-bottom: 10px;margin-right: 10px;">  
           
{{fil.controlName | slice:3:15}}    
           
<Select id="{{fil.controlName}}" (change)="onChange($event)" class="form-control" style="width:200px; margin-right:10px;">  






               
<option value="0">-Select-</option>  
                 
<option *ngFor="let fil2 of this.FilterBinddata"  >  
                   
<div *ngIf="fil.controlName===fil2.filterName" >  
                   
{{fil2.reportSource}}  
                 
</div>  
                 </
option>  








     
</Select>  


       <div>  
       </
div>  


       
</div>  

Reply all
Reply to author
Forward
0 new messages