html - Why JQuery Autocomplete displays only one item? -
I'm using JQuery autocomplete on my temple, but when I get results I show myself completely an item, Regardless of that the result is more than one item, it only shows the first item in the list!
Example:
If I have a result list with ('python', 'pythonism', 'Pythruss')
< P> And on the autocomplete type, 'pyt' it displays only the 'Python' on the drop down!My complete code:
$ (document) .ready (function () {$ ("# tags1"). Auto Complete ("/ taglookup /" , {Width: 320, maximum: 4, highlight: false, multiple: true, multiple separator: ",", scroll: true, scrollwise: 300, delay: 10});}); def tag_ lookup (request): # default return list result = [] if request.method == "
get": If requested is. GET.has_key (u'q '): value = request. GET [u'q '] #LAN (value) & gt; 2: TI = Tag.objects.filter (name__contains = value) Results of print ti = [ti in x for x for x] print result # shows me that more than one item has returned HttpResponse ('.') . Mime type = 'text / plain')
Friends, just found out that JQuery Auto Using a full plugin item requires a new line character as a separator, so I changed my Ajax Django view to read like this;
return HttpResponse ('\ n'.join (results), mime type thanks.
Comments
Post a Comment