This doesn't answer the question.
On Thursday, January 8, 2015 6:50:22 PM UTC+1, Collin Anderson wrote:
-- On Thursday, January 8, 2015 6:50:22 PM UTC+1, Collin Anderson wrote:
Hi,It's a bit hacky, but I've used filter_horizontal outside of the admin before.from django.contrib.admin import widgets
class MyForm(forms.Form):
users = forms.ModelMultipleChoiceField(
required=False,
widget=widgets.FilteredSelectMultiple (verbose_name='Field Name', is_stacked=False),
queryset=choices_qs,
initial=initial_qs,
)<link rel="stylesheet" href="/static/admin/css/widgets.css" >
<script>function addEvent(obj, evType, fn){obj.addEventListener(evType , fn, false)}</script>
<div>{{ form }}</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/ "></script>jquery.min.js
<script>django = {jQuery: $}</script>
<script src="/admin/jsi18n/"></script>
{{ form.media }}CollinOn Monday, January 5, 2015 at 12:39:39 AM UTC-5, ebuild wrote:I'm wondering if there is a standard way to add a javascript-based filter on the right box like the one in the left
when having manytomany relation with filter_horizontal.
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/2cf03a2d-b2b0-4f44-93b4-bb7eec3b464f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment