View Full Version : How to scroll browser window when modal window has bigger size?

4 Oct 2010, 10:49 PM
I have a modal window opening on button click, and it's height is about 800px, so it can be higher than browser window.
After modal window showing, it's content is cut under browser size, but browser window scrollbars do not appear.
Interesting thing is with mouse scroll (pushing mouse scroll button and dragging the mouse) we can scroll to hidden form part, although modal shade displays only on browser window size.

Tried to add autoScroll: true, autoHeight: true (excluding fixed height) to the window. Tried to render it to Ext.getBody() or Viewport.

The same behaviour appears when on window opening browser window size is big enough, and then it is diminished.

If the window is opened not by click, and displayed just on ready, browser scrollbars work correctly.

5 Oct 2010, 1:03 AM
It's confusing to the user that you need to scroll the document to view a big window.

Instead, make the window itself scrollable and calculate the available height before showing the window.

5 Oct 2010, 1:23 AM
How to do this with Ext?
I tried to set window's autoScroll to true, but it does not.
How to calculate avaliable height? Take it from Ext.getBody() or Viewport?

Anyway, I prefer scrolling document rather than window. IMHO scrolling window is much more ugly then scrolling browser window.
But is scrolling document possible?

5 Oct 2010, 1:27 AM
1. You could use Ext.getBody().getViewSize().
2. A Viewport can't scroll. You would have to replace your viewport with a simple container and manage the size yourself (e.g. by using the FitToParent plugin).