Why does appadmin have css overflow: hidden in database results?

55 views
Skip to first unread message

User

unread,
Apr 12, 2014, 9:01:35 PM4/12/14
to web...@googlegroups.com
In appadmin, if I query a table that has more columns than the width of my browser there will be a horizontal scrollbar places on the div containing the database rows.  I find this annoying because in order to scroll horizontally I have to go to the bottom of the search results first to find the horizontal scrollbar and then scroll.

If the containing div had overflow: visible then I could use the browser's horizontal scrollbar which is much more convenient.  My question is what purpose does having overflow = hidden serve in this context?

Paolo Caruccio

unread,
Apr 13, 2014, 5:37:53 AM4/13/14
to web...@googlegroups.com
If you mean the view "appadmin/select/db?query=your query" actually the table with the resulting rows is wrapped in a div with "overflow:auto".
Therefore if you have more columns than the width of the browser a horizontal scrollbar will be shown and the table will scroll horizontally. The horizontal scrollbar (that is managed by browser not by web2py) is positioned after the last displayed row but you can scroll the table with arrow keys on the keyboard.
For the sake of completeness, if the div wrapper had "overflow:hidden" you couldn't see any scrollbar.

User

unread,
Apr 13, 2014, 7:32:41 AM4/13/14
to web...@googlegroups.com
Sorry you're right it's auto not hidden that was a typo.  But why not make it visible?

Paolo Caruccio

unread,
Apr 13, 2014, 1:46:32 PM4/13/14
to web...@googlegroups.com
With overflow:auto the scrollbars (vertical and horizontal) are visible only when it is necessary.
Making scrollbars visible only when you need them is for aesthetic reasons. Indeed not all the tables have a great number of columns. 

User

unread,
Apr 14, 2014, 2:25:20 AM4/14/14
to
Yes but with overflow:visible (the default css setting) there are no scroll bars and if the table has enough columns then the browser will show a horizontal scrollbar anyway as part of the browser window (as opposed to with auto showing the scrollbars as part of the div).  With "auto" It just gives the feeling of html frames which I thought most people agree are annoying except in limited circumstances.

For me it just seems like overflow: auto is just an annoyance with no benefit, but I was wondering if there was something I was overlooking. 

Paolo Caruccio

unread,
Apr 14, 2014, 9:16:34 AM4/14/14
to web...@googlegroups.com
Now I see your POV. You are speaking about browser's scrollbars and not about div content area scrollbars. The "overflow:auto" setting has been applied to the container div of the result table for aestethic reasons because such div should have a width of 80% but there is a bug in the code. I will send a patch on web2py issue tracker.
Anyway, if you are not confortable with "overflow:auto" and since appadmin is a part of w2p application you can easily customize it by replacing the line 68 in  /views/appadmin.html with a simple "<div>". 

Il giorno lunedì 14 aprile 2014 08:25:00 UTC+2, User ha scritto:
Yes but with overflow:visible (the default css setting) there are no scroll bars and if the table has enough columns then the browser will show a horizontal scrollbar anyway as part of the browser window (as opposed to with auto showing the scrollbars as part of the div).  With "auto" It just gives the feeling of html frames which I thought most people agree are annoying except in limited circumstances.

For me it just seems like overflow: auto is just an annoyance with no benefit, but I was wondering if there was something I was overlooking. 

On Sunday, April 13, 2014 1:46:32 PM UTC-4, Paolo Caruccio wrote:

User

unread,
Apr 14, 2014, 6:00:29 PM4/14/14
to web...@googlegroups.com
Yes agree I did modify my own appadmin copy but I guess don't see why anyone would want the overflow auto in this context.  I understand it's for aesthetic but from my POV it's appadmin so this is not end users using it.  My thinking was that if I'm annoyed by it others would be too and we should change the default as one drop in the bucket of making web2py better.

Paolo Caruccio

unread,
Apr 15, 2014, 10:11:47 AM4/15/14
to web...@googlegroups.com
As I said in my previous post, the wrapper of the results table has a specific width (80%). In this case we have to set overflow:auto otherwise the width is overriden due to the default overflow:visible.
In order to explain better the concept we could add a border to the wrapper div. Please see the attached images. 
overflow_2.png
overflow_1.png
Reply all
Reply to author
Forward
0 new messages