Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5933265
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T14:56:57+00:00 2026-05-22T14:56:57+00:00

I quite like the filter feature of django admin views ( list_filter ). But,

  • 0

I quite like the filter feature of django admin views (list_filter).

But, on views with a lot of fields, I would really like the ability to minimize/expand it with a click, to save screen real-estate and also because it sometimes actually hides stuff.

Is there an easy way to add a collapse button (some already existing plugin I haven’t found or something similar)?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T14:56:58+00:00Added an answer on May 22, 2026 at 2:56 pm

    Given that you now have jQuery in django admin, it’s easy to bind a slideToggle() to the titles in the List Filter.

    This seems enough Javascript for it to work:

    // Fancier version https://gist.github.com/985283 
    
    ;(function($){ $(document).ready(function(){
        $('#changelist-filter').children('h3').each(function(){
            var $title = $(this);
            $title.click(function(){
                $title.next().slideToggle();
            });
        });   
      });
    })(django.jQuery);
    

    Then in the ModelAdmin subclass you want to activate that set the Media inner class:

    class MyModelAdmin(admin.ModelAdmin):
      list_filter = ['bla', 'bleh']
      class Media:
        js = ['js/list_filter_collapse.js']
    

    Make sure to drop the list_filter_collapse.js file in a ‘js’ folder inside your STATIC_DIRS or STATIC_ROOT (Depending on your Django version)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have UltraMon installed and quite like it but I would also find it
This is quite complicated but i would like to be able to refresh a
I am quite new about using Solr, but would like to ask your help.
Iam quite new to functions in SQL and I would like to create a
I would like to be able to filter a listbox containing 1000 strings, each
I'm looking into using a javascript logging framework in my app. I quite like
Starting from scratch is hard. How do you do it? I quite like color
Can anyone recreate this issue? It seems to me like a quite serious bug
I feel like this is quite delicate, I have various folders whith projects I
It seems like I had to inline quite a bit of code here. I'm

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.