not filled with datasource

Hi,

i was trying the drop down list control. And my intention was to bind it to a json data i got from Ajax. After various intents y tried the simplest demo from the documentation. And the same behaviour.

I dont know what im missing.

If someone can help, thank you in advance ;)

I attached the html file.

Attachment: simple_cbe46e22.zip

3 Replies

KV Karthikeyan Viswanathan Syncfusion Team August 3, 2018 07:21 AM UTC

Hi Miguel, 

Thank you for contacting Syncfusion support. 

We have checked the shared sample in our end. It seems that you have used the <select>  element with JSON dataSource to render DropDownList component. <select> element requires <options> instead of JSON. So, we suggest you to use <input> element instead of the select element.  
Please refer to the following code snippet. 

<input id='selectUser' type="text" /> 
 
<script> 
let sportsData = ['Badminton', 'Cricket', 'Football', 'Golf', 'Tennis']; 
var listObj = new ej.dropdowns.DropDownList({ 
    dataSource: sportsData,  
    placeholder: "Select games" 
}); 
listObj.appendTo('#selectUser'); 
</script> 


Regards, 
Karthikeyan V. 



MV Miguel Varela Rodriguez August 3, 2018 08:23 AM UTC

Thank you :) that helped a lot!!!


KV Karthikeyan Viswanathan Syncfusion Team August 3, 2018 08:38 AM UTC

Hi Miguel,   
 
We are glad to hear that your issue has been resolved.   
 
Regards,  
Karthikeyan V.  


Loader.
Up arrow icon