in Using jQuery UI • 23 days ago
I am trying to make the following autocomplete code work but cannot identify the errors in the code. A very basic autocomplete works but I’d like to add caching and the ability to change the list that pops up, but I could not do so following the jquery instructions.
Here is the code first:
And here is my jquery, at the bottom of the page:
The issue is with the source: and _renderMenu items. Remove those two methods and the autocomplete works (if I use my normal source url in place of the source function). I have tested that it is sending and receiving the correct JSON and it does.
The attempt to enable caching with the "source:" method gives an error “TypeError: Invalid ‘in’ operand a” in the jquery code itself.
Adding alternating stripes following the example for " _renderMenu: " usage seemed to have no effect, but the autocomplete still works if I add it.
In case there are better ways to achieve what I am going for, I’d like to hear about them. I am trying to cache results and also allow for changing the way the popup menu displays (adding alternating stripes) in the return results.
I’m using Jquery UI 1.11.4 and jquery 2.1.1.
- 8 Replies
- 315 Views
- 1 Followers