Unable to load remote data into ComboBox

1 Answer 62 Views
ComboBox Data Source
Sky
Top achievements
Rank 1
Sky asked on 24 May 2021, 04:57 PM | edited on 24 May 2021, 05:03 PM

Hi,

I have a combbox where the choices are driven by a remote datasource as follows:

main.php
-----------------------
<script>
var dataSource = new kendo.data.DataSource({
    transport: {
        read: {
            url: "select_data3.php?type=123",
            dataType: "json"
        }
    }
});

$("#event_id").kendoComboBox({
    dataTextField: "Text",
    dataValueField: "Value",
    filter: "contains",
    dataSource: dataSource,
    placeholder: "Select a product",
});
</script>

<select id="event_id" style="width: 450px;">
</select>

 

select_data3.php
-----------------
<?php header('Content-Type: application/json');?>
[{"Text":"AUT","Value":"Austria"}, {"Text":"BEL","Value":"Belgium"}, {"Text":"BGR","Value":"Bulgaria"}]


It's unable to load remote data into combobox


And i had tried to
1. copy http://dojo.telerik.com/IzAWU to my localhost
2. download //demos.telerik.com/kendo-ui/service/Products to local folder
3. It's good for execute step1 directly
4. Show nothing, when i modify params to "//localhost/test/Products" and "json"


1 Answer, 1 is accepted

Sort by
0
Neli
Telerik team
answered on 27 May 2021, 12:11 PM

Hi,

From the provided information I am not sure what could be the cause of the issue.

Could you please double-check in the Network tab of the developer tools in the browser if the response is returned without any errors? Are there any errors in the browser console? 

You could also take a look at the Forum thread linked below regarding data not populating.

https://www.telerik.com/forums/dropdownlist-not-populating-with-data-from-datasource

Regards,
Neli
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
ComboBox Data Source
Asked by
Sky
Top achievements
Rank 1
Answers by
Neli
Telerik team
Share this question
or