View Full Version : layout problem

Michael J.
14 Jun 2011, 5:40 AM
Please, help my with layout problem.
If I want to have a flexible Panel which flexes when window is maximized to window size, but when window is minimized, it flexes until minWidth value and then horizontal scroll appear.
This behavior is rather common, but no of existing layout can cover it - hbox, has no scrollbar and always suit window size, anchor just hide a part of panel when it less then minBoxWidth. May be some combination can help?

16 Jun 2011, 11:15 AM
It isn't that common, horizontal scrollbars are generally frowned upon. It might be better to make the minimum width of your window such that this isn't necessary.

That said, a quick play suggests you might be able to achieve the desired effect with a bit of CSS and a little hacking of hbox:

new Ext.Window({
height: 300,
width: 300,
items: {
flex: 1,
minWidth: 250
layout: {
align: 'stretch',
innerCls: 'x-box-inner auto-scroll', // Undocumented config option
type: 'hbox'

.auto-scroll {
overflow-x: auto;

There may well be a neater way to do this with one of the other layouts and a bit of CSS.