Implementing custom autocompleter
I wanted to know what autocompleter library you are using.
I'm trying to create another instance of this autocompleter that doesn't have space separated values(like how tags work), it simply needs to autocomplete only one value. I figured autocompleteMultiple=false would work as per this example.
{%- macro location_autocomplete_js(id = '#id_location') -%}
var locationAc = new AutoCompleter({
url: '{% url "get_location_list" %}',
minChars: 3,
useCache: true,
maxCacheLength: 100,
matchInside: false,
autocompleteMultiple: false,
delay: 10,
});
locationAc.decorate($("{{ id }}"));
{%- endmacro -%}
But I'm having no luck. Also it is possible to use this for json driven autocompletion. I wish to retrieve both names and unique ids from the server and use the unique id in the post request.
Cheers!
Comments