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

[Solved] Autocomplete dropdown not working

5 Answers 276 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.
Joseph
Top achievements
Rank 1
Joseph asked on 21 Jun 2011, 04:28 PM
Hi,

I am trying to implement an autocomplete box however I am having trouble getting the autocomplete drop down happening. It is being bound successfully and the data is being pushed across. However when the user starts typing the expected behaviour of the autocomplete dropdown doesn't happen.

Curiously I can successfully implement them within partial views that are returned via ajax.

After some investigation, I noticed that the returned HTML is missing javascript specifying the  "selectURL"
eg. ajax:{"selectUrl":"/Services/_FillAutocomplete"}

I believe I am overlooking something very simple here, possibly something to do with the script registrar.


thankyou for your time,
Joe

5 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 21 Jun 2011, 04:43 PM
Hi Joseph,

This is the normal way of serializing the selectUrl so this should not be the problem. Is the AutoComplete making any ajax requests when the user starts typing? You can check that using a tool such as Fiddler or FireBug. Alternatively you cansee if your action method gets hit by adding a breakpoint in it and start debugging.

If ajax requests are made then you can check for any JavaScript errors in the page happening after that.

If ajax requests are not made then maybe you have missed a ScriptRegistrar declaration or the required JavaScript files are not included. The latter may happen if you are loading the autocomplete via ajax (inside a partial view). If this is the case you can check this help article.


Regards,

Atanas Korchev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Joseph
Top achievements
Rank 1
answered on 22 Jun 2011, 01:02 PM
Hi Atanas,

Thank you for your reply. However we are already aware of using the AJAX options to call the initialize javascript on partial loads.

The thing we cannot wrap our heads around is when we put the control on a page that is loaded via AJAX it works. When we put it on the site master or any page that is rendered through html.RenderPartial it does not work.

(we are current having a similar problem with grids but i will refrain from opening a second call till this is solved, because the fix  could be similar.)
0
Joseph
Top achievements
Rank 1
answered on 22 Jun 2011, 01:09 PM

Additional Info:

Its almost like the controls are not being initialized. (the ones on NON ajax pages!!! weird!)

And yes sorry forgot to include this in the original request: Break point on server side methods never fire.
0
Atanas Korchev
Telerik team
answered on 23 Jun 2011, 07:04 AM
Hello Joseph,

 The last thing I can suggest is to check if your ScriptRegistrar is *after* all Telerik extensions. You can also check the generated output to see if the initialization script is rendered.

 If this does not help either I would ask you to provide a sample project which shows the problem. We will troubleshoot it and see what went wrong.

Regards,
Atanas Korchev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Joseph
Top achievements
Rank 1
answered on 23 Jun 2011, 07:26 AM
thankyou Atanas, this now works.
Tags
ComboBox
Asked by
Joseph
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Joseph
Top achievements
Rank 1
Share this question
or