omji / django-tabbed-admin

Easily add tabs to django admin forms
BSD 3-Clause "New" or "Revised" License
63 stars 68 forks source link

Missing horizontal scrollbar when using TabularInline with many fields #30

Open JohnnyBDude opened 5 years ago

JohnnyBDude commented 5 years ago

Thanks for great django plugin, i love it!

I have an issue with how TabularInline with many fields is displayed.

Without tabs, there is a horizontal scrollbar on the lower edge of browser window. When i add tabs, this scrollbar goes missing and i have no way of displaying fields that don't fit on the screen. I can use StackedInline to mitigate this, but tabular view is so much better suited for this particular usecase.

What might be the problem? Is there a way to fix this? Thanks!

piyush4793 commented 5 years ago

@JohnnyBDude I am facing the same issue. Did you came up with any solution?

newprincip commented 4 years ago

@JohnnyBDude @piyush4793 I understand that you probably don’t need it already, but someone may come in handy

You must modify css

default css from this library (https://github.com/omji/django-tabbed-admin/blob/master/tabbed_admin/static/tabbed_admin/css/tabbed_admin.css)

#tabs{clear:both}.ui-state-default a.errortab{background-color:red;color:white}.ui-tabs .ui-tabs-panel{overflow:hidden}

needed (You must add this code in file 'admin/custom_tabbed_admin.css' in static directory your project )

#tabs{clear:both}.ui-state-default a.errortab{background-color:red;color:white}.ui-tabs .ui-tabs-panel{overflow:visible}

You must remove this in settings:

TABBED_ADMIN_USE_JQUERY_UI = True

...and set css and js in Media:


class MyModelTabbedModelAdmin(TabbedModelAdmin):
    #...

    class Media:
        css = {
            'all': ('tabbed_admin/css/jquery-ui-1.11.4.min.css', 'admin/custom_tabbed_admin.css', )
        }
        js = ('tabbed_admin/js/jquery-ui-1.11.4.min.js', )