Support for FilteredSelectMultiple widget for m2m fields in the admin page

53 views
Skip to first unread message

vijaysuren

unread,
Nov 29, 2016, 4:38:55 AM11/29/16
to Django Grappelli
Hi,

I am using django-grappelli 2.9.1 with Django 1.10.2 for the admin page.
In the earlier versions for django-grappelli and Django, if a m2m field is included in the 'filter_horizontal'
the FilteredSelectMultiple widget was used for m2m fields.

But in the latest version this seems to be missing and the reason is that one of the dependencies for SelectFilter2.js, 
the addevent.js has been removed.

I made a workaround to make this work.  I added the below lines in 'grappelli/templates/admin/base.html' after the
specification of jquery.js files.

   <script type="text/javascript">
       addEvent(window, "load", function(e) {
           SelectFilter.init("", "", 0, "/static/admin/"); 
       });
   </script>


Could this be included in the django-grappelli package so that I don't have to maintain the patched version.
Or if there is a better way to do this please let me know.

Hope this issue will be seen by many of the users.

Thanks and regards,
Vijay.

patrick kranzlmueller

unread,
Nov 29, 2016, 4:40:04 AM11/29/16
to django-g...@googlegroups.com
that seems to be a bug with grappelli. please open a ticket.

--

---
You received this message because you are subscribed to the Google Groups "Django Grappelli" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-grappelli+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages