Add dropdown with datasource from web api to grid, datasource not reload

Hi,
I'm trying to add a dropdown to grid and when try draw a dropdown with queryCellInfo event, datasource don't populate.

Here is a sample of my code:


What i'm doing wrong?

Thanks,
Marco Andrade

3 Replies

SG Saravanan G Syncfusion Team July 6, 2018 09:41 AM UTC

Hi Marco Andrade,      
      
 Thanks for contacting Syncfusion Support.   
  
We have validated the shared sample.  We suspect that the issue will be raised due to append an incorrect element into DropDownList instead of using element.   
  
Please refer to the below given code.      
      
<code>   
   function dropdown(args) {   
 
           let elment = args.cell.querySelector('select');   
 
           if (elment === null) return;   
    
            let dropdown = new ej.dropdowns.DropDownList({ dataSource: roles, fields: { value: 'id', text: 'name' }, value: args.data.roleId });   
  
            dropdown.appendTo(elment);   
     }   
   
   
</code>   
      
 If still you have an issue in this sample, please share the roles data. It will be helpful us to provide an appropriate solution.    
    
Saravanan G 



MA Marco Andrade July 6, 2018 04:55 PM UTC

Thanks Saravana but still not working. The control is appearing but datasource not populate.

Thanks,
Marco Andrade


KV Karthikeyan Viswanathan Syncfusion Team July 9, 2018 10:43 AM UTC

Hi Marco Andrade,   
 
We are deeply regret for this inconvenienced.  
 
We can’t find out the exact root cause this issue. 
 
 So, could you please share the below details: 
 
  • The code snippet of accountaccess controller, you have used in previous shared code snippet.
  • The Screenshot which showcase if any console error occur.
  • The video which showcase the issue .
 
  It will be helpful us to provide a solution at earlier.  
   
  
Regards,   
Karthikeyan V.  


Loader.
Up arrow icon