darklow / django-suit

Modern theme for Django admin interface
http://djangosuit.com/
Other
2.32k stars 704 forks source link

enhancement: Add select2 support to admin change list filters #303

Open arthanson opened 9 years ago

arthanson commented 9 years ago

Select2 integration works great in the admin change-forms but getting it to work in the changelist filters (for example in the demo http://djangosuit.com/admin/examples/city/ the country drop-down at the top of the chagelist) is problematic.

It would be great if django-suit could enable this to work.

etanter commented 9 years ago

I added the following script to change_list.html

$(function () {
    $(document).ready(function() {
        $('#changelist-search > div > span > select').select2({dropdownAutoWidth: true});
    });
  }(Suit.$));

and it works fine!

HTH

(make sure you import js/select2.js and css/select2.css)

deepakvashist commented 7 years ago

@arthanson @etanter Hi, can you help my project? It's working.

https://github.com/deepakvashist/django-admin-select2