1. #1
    Sencha User
    Join Date
    Nov 2010
    Posts
    22
    Vote Rating
    0
    Michael J. is on a distinguished road

      0  

    Default layout problem

    layout problem


    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?

  2. #2
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,605
    Vote Rating
    326
    skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future

      0  

    Default


    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:

    Code:
    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'
        }
    }).show();
    Code:
    .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.

Thread Participants: 1