Django - Making TabulerInline's classes to collapse -


i want hide/show inlines in admin interface providing classes': ['collapse']}). there way achieve this?

i don't know how official way, first thought override admin html template , put there short jquery script like:

    $('inline-panel-selector').click(function() {$(this).toggle(200);}); 

edit:

as template should overriden, take here:

http://docs.djangoproject.com/en/dev/ref/contrib/admin/#overriding-admin-templates http://docs.djangoproject.com/en/dev/ref/contrib/admin/#templates-which-may-be-overridden-per-app-or-model

-- think should change_form.html , this:

{% extends "change_form.html" %} {% block footer %}     {{ block.super }}     <script type="text/javascript">         $(function (){             $('inline-panel-selector').click(function() {$(this).toggle(200);});         });     </script>  {% endblock %} 

note i'm not sure if $ symbol available, tells me django doesn't expose it, using django.jquery instead.


Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

aspxgridview - Devexpress grid - header filter does not work if column is initially hidden -

c# - How to execute a particular part of code asynchronously in a class -