Hi Jose,
Thanks for you reply.
Following your suggestion, and making one adjustment:
return dict(suggestions=json.dumps(countries))
the controller/function jsonsource/name_autocomplete now returns a correct list:
["first_option", "second_option", "third_option"]
In layout.html before the closing body selector I've got:
<script type="text/javascript">
$(document).ready(function() {
$(function() {$("#dummy_table_name").autocomplete({serviceUrl: "{{=URL('jsonsource', 'name_autocomplete')}}", minChars: 2});});
});
</script>
When typing some name in the auto complete field I get the following error:
Uncaught SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data jQuery 6
d
currentRequest
c
fireWith
l
o
When I use a local look up like this:
<script type="text/javascript">
$(document).ready(function() {
var suggestions = ["first_option", "second_option", "third_option"]
$(function() {$("#dummy_table_name").autocomplete({lookup: suggestions, minChars: 2});});
});
</script>
the autocomplete works, however, I need the ajax lookup, I hope you can help me
solve this one last issue.
Kind regards,
Annet