Django-selectable: no dropdown list

I am trying to use django-selectable http://django-selectable.readthedocs.org/en/version-0.6.2/quick-start.html

I configured everything that I can say correctly (see punch). A request is made in FireBug and a valid JSON is returned. Everything works, but the results are not displayed. I have included CSS.

Any reason why I don't see the drop down list?

FF has this error:

TypeError: this.menu is undefined [Break On This Error] if ( this.menu.element.is( ":visible" ) ) { 

models.py

 class Event(models.Model): event_id = models.IntegerField(primary_key=True) name = models.CharField(max_length=80,blank=False) date = models.DateField() start = models.TimeField() end = models.TimeField() category = models.ForeignKey(Category) city = models.ForeignKey(City) user = models.ForeignKey(User) def __unicode__(self): return self.name 

lookup.py

 from selectable.base import ModelLookup from selectable.registry import registry from events.models import Event class EventLookup(ModelLookup): model = Event search_field = 'city__icontains' filters = {'active': True, } def get_item_value(self, item): # Display for currently selected item return item.name def get_item_label(self, item): return u"%s (%s)" % (item.name) registry.register(EventLookup) 

forms.py

 from django import forms from django.forms import ModelForm from events.models import Event import selectable.forms as selectable from events.lookups import EventLookup class EventForm(ModelForm): autocomplete = forms.CharField( label='Type the name of a fruit (AutoCompleteWidget)', widget=selectable.AutoCompleteWidget(EventLookup), required=False, ) class Meta: model = Event 

urls.py

 (r'^selectable/', include('selectable.urls')), 

template.html

  **the following is loaded in correctly...** jquery-1.9.0.js jquery-ui-1.10.0.custom.min.css jquery.ui.core.js jquery.ui.widget.js jquery.ui.datepicker.js jquery.ui.autocomplete.js {{ form.media.css }} {{ form.media.js }} {{ form }} 
+4
source share
1 answer

It looks right, I think:

1) you are not including js files in the correct order

or

2) you do not download them correctly.

Add to the head below and delete your links, see if it works ...

 <link rel="stylesheet" href="//ajax.googleapis.com/ajax/libs/jqueryui/ 1.8.13/themes/ui-lightness/jquery-ui.css" type="text/css" /> <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/ jquery/1.4.4/jquery.min.js"></script> {{ form.media.js }} <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/ jqueryui/1.8.13/jquery-ui.min.js"></script> {{ form.media.css }} 
+4
source

All Articles