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

[Solved] Autocomplete not showing list

2 Answers 159 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Navneet
Top achievements
Rank 1
Navneet asked on 08 Jun 2012, 01:34 PM
Hi,

We are using autocomplete feature. We see that the AJAX call to get the data is successful and even the count is correct. But we don't see the list on the client.
In firebug, we see the response stream has the JSON data.

 @(Html.Telerik().AutoComplete()
            .Name("AutoCompletemspeclty")
            .Value(@Model.mspeclty)                          
            .DataBinding(binding => binding.Ajax()
                    .Select("GetSpecialty", "Utility") )               
             .AutoFill(true)
             .HighlightFirstMatch(true)

             )

Note: We have registered all the required scripts in the master page.
      @(Html.Telerik().ScriptRegistrar().Globalization(true)
                                .DefaultGroup(group => group
                                    .Add("jquery-1.7.1.min.js")
                                    .Add("telerik.common.min.js")                                   
                                    .Add("telerik.list.min.js")
                                    .Add("telerik.autocomplete.min.js")
                                    .Combined(true).Compress(true))
                                    .jQuery(false))

The same code works in another project. This must be simple but we have spend a day figuring this one out.

2 Answers, 1 is accepted

Sort by
0
Roger
Top achievements
Rank 1
answered on 03 Jul 2012, 07:12 AM
I have the same problem however the autocomplete works for one data set and not another.
e.g.
it works for a city list returning "cityname, zipcode" but not for a "name, id" list - when I transplant one for the other the city name list works but the name, id list doesnt - have tried all sorts of combinations
e.g. list of strings is returned through ActionResult 
as JSON

CITY1,1234
CITY2,2345
CITY3,4566

works

but

Harry Who,1
Harry Who,2
Harry Who,3

doesnt....

any ideas - very strange behaviour...


I have a zip code autocomplete that exhibits the same thing..

type in a cityname and return a list of xzipcodes (reverse of above) e.g.

1234,CITY1
2345,CITY2

doesnt display in the client.

not a script register issue I believe because the city list works.  sniffing shows data coming through to the client... so what is it?
thx


0
Navneet
Top achievements
Rank 1
answered on 03 Jul 2012, 01:05 PM
Roger:

My issue was that the initial value of the autocomplete was not trimmed. Once the initial value was trimmed, auto complete started showing the list items.

Best,
Navneet
Tags
ComboBox
Asked by
Navneet
Top achievements
Rank 1
Answers by
Roger
Top achievements
Rank 1
Navneet
Top achievements
Rank 1
Share this question
or