0

Grid for reference

1

I was trying to add dynamic dropdown for 'beneficiaryBankAccount' column based on the value of 'ReceivedFrom' column i.e. in every row for same column 'beneficiaryBankAccount' the dropdown list will be different.

sometimes after selecting the 'ReceivedFrom' column data values for 'beneficiaryBankAccount' column are not rendering properly.

this is how I am setting columnDef:

this is how I am rendering option List for 'beneficiaryBankAccount' after selecting value of 'ReceivedFrom' column.

result =[{ accountNumber: "NA", bankName: "NA", bankLocation:"NA", swiftCode:"NA"}];  
          const {costcenter,cdoptions, subEntry,bankoptions, bankDetails }=this.state;            
this.setState({                
    bankDetails:result,                
    columnDefs: ColumnDef.map((data) => {   
                  if (data.field === "bankDetails") 
                {                        
                return {                            
                    ...data,                            
                    cellRendererParams: {                                
                    entryoptions: result                                
                    .map((option) => `${option.accountNumber}-${option.bankName}`),                                
                    width: data.width,                            
                    },};                    
                }                                      
                return data;                
                })            
                })

based on values of 'ReceivedFrom' column data of last column is getting called.

usually dropdown list is getting rendered but sometimes list is not coming! don't know where things are going wrong.

vimuth
  • 5,064
  • 33
  • 79
  • 116
Ashwin
  • 1
  • 1
  • 3

0 Answers0