This is a migrated thread and some comments may be shown as answers.

Autocomplete not populate

2 Answers 112 Views
AutoComplete
This is a migrated thread and some comments may be shown as answers.
Jianwei
Top achievements
Rank 1
Jianwei asked on 21 Aug 2014, 08:52 PM
I have an autocomplete control to call server code to get databack, from the server response, I see the data is passed back correctly, however, it's not populating the list, it shows "loading" icon forver, any idea.

Here is how I configure

  <input id="institutionAutoComplete" 
           data-role="autocomplete"
           data-placeholder="Type an institution name "
           data-min-length="4"           
           data-value-primitive="true"
           data-text-field="Name"
           data-bind="value: selectedInstitution,source: institutions" />
    <br />


var degreeVm = kendo.observable($.extend({
            institutions:new kendo.data.DataSource({
                transport: {
                    read: {
                        url: '@Url.Content("~/CommonData/GetInstitutionList")',
                        data: {
                            name: function(){
                                return $("#institutionAutoComplete").data("kendoAutoComplete").value();
                            }
                        },
                        dataType: "jsonp"
                    }                    
                },
                schema: {
                    data:function(data) {
                        return data;
                    }
                }
            }),
},@(Html.ToJson(Model)))); Here is the data I received back from server
0: {Id:11, Name:The Ohio State University, InstitutionIdentifier:810, City:null, StateId:null,…}City: nullCountryId: 0Id: 11InstitutionIdentifier: "810"Name: "The Ohio State University"StateId: null








2 Answers, 1 is accepted

Sort by
0
Jianwei
Top achievements
Rank 1
answered on 21 Aug 2014, 09:10 PM
I also posted an example here http://jsbin.com/lahiqoviquhi/1/edit
0
Accepted
Georgi Krustev
Telerik team
answered on 25 Aug 2014, 11:33 AM
Hello Jianwei,

I couldn't load the demo, because the server request failed (DNS server couldn't locate the server). Based on the given information, I suppose that there is a JavaScript error which breaks the widget. Could you wire the error event of the data source and check whether there are any errors?

Regards,
Georgi Krustev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
AutoComplete
Asked by
Jianwei
Top achievements
Rank 1
Answers by
Jianwei
Top achievements
Rank 1
Georgi Krustev
Telerik team
Share this question
or