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
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,
the Telerik team
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.)
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.
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.
Atanas Korchev
the Telerik team