Results 1 to 5 of 5

Thread: Column Layout window resize problem

  1. #1
    Sencha User artalat's Avatar
    Join Date
    Jun 2009
    Location
    Lahore, Pakistan
    Posts
    44

    Question Column Layout window resize problem

    Hi, im a beginner and just starting to learn ext. Ive run into a problem and cant really seem to either find or understand the solution. Ive made a column panel with 3 columns. 2 columns have a fixed size while the third one is supposed to cover the rest of the space. This works just fine, but when i resize the browser window the column dont adjust automatically to the new size.

    Thanks in advance.

    var myPanel = new Ext.Panel(
    {
    layout : "column",
    renderTo: "main",
    title: "Column Panel",

    items :
    [{
    title : false,
    border: false,
    width: 210,

    items :
    [{
    xtype : "panel",
    title : "Panel",
    html : "hello there",
    }]
    },{
    title : false,
    border: false,
    columnWidth:1,
    items :
    [{
    xtype : "panel",
    title : "Panel",
    html : "hello 1",
    },{
    xtype : "panel",
    title : "Panel",
    html : "hello 2",
    }]
    },{
    title : false,
    border: false,
    width: 210,
    items :
    [{
    xtype : "panel",
    title : "Panel",
    html : "hello there",
    }]
    }]
    });
    Also i noticed if i do var myPanel = new Ext.Viewport instead that does the trick.

  2. #2
    Sencha User jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    DC Area =)
    Posts
    16,364

    Default

    you columnWidths need to be relative.

    In fact, have you considered using the hbox layout?

  3. #3
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,890

    Default

    What do you expect? Why would a Panel do anything in particular on Window resize? Panel is a general purpose Panel class.

    You must use a Viewport.

  4. #4
    Sencha User artalat's Avatar
    Join Date
    Jun 2009
    Location
    Lahore, Pakistan
    Posts
    44

    Default

    Quote Originally Posted by [email protected] View Post
    you columnWidths need to be relative.

    In fact, have you considered using the hbox layout?
    ok thanks! ill look into hbox layout.

    But basically what i want to two fixed width columns, and one variable size with a minWidth. So when the browser window is resized the column width is adjusted accordingly, but when it reaches minWidth limit, browser scrollbars are shown.

    What would be the best way to go about something like this? I hope im making my point clear .

    Thanks

  5. #5
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,890

    Default

    A Viewport with layout: 'hbox'

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •