Results 1 to 6 of 6

Thread: Going South...

  1. #1
    Ext JS Premium Member
    Join Date
    Feb 2009
    Posts
    28

    Default Going South...

    Why does the 'autoHeight:true' seem to fail in the code below?


    //the following code
    //does not display the bottom 2 panels
    //with text, 'in the center south', and
    //'in the deep south'

    Ext.onReady(function()
    {
    var vp = new Ext.Viewport(
    {
    renderTo: document.body,
    title: "Testing with Title",
    layout: 'border',
    autoHeight: true,
    items:
    [
    {
    region: "south",
    xtype: 'panel',
    //title: "to the south",
    layout: 'border',
    autoheight: true,
    items: [
    {
    region: 'center',
    //height: 200,
    width: 300,
    autoHeight: true,
    html: 'in the center south'
    },
    {
    region: 'south',
    //height: 200,
    width: 300,
    autoHeight: true,
    html: 'in the deep south'
    }]
    },
    {
    region: 'center',
    html: "I am in the center"
    }]
    });
    });

  2. #2

    Default

    you have to specify the height for north, south region and width for east,west region.
    don't use autoheight.
    size of center region will be calculated automatically based on other region.

  3. #3
    Ext JS Premium Member
    Join Date
    Feb 2009
    Posts
    28

    Default Is there an alternative way to adjust the height automatically...

    Let's say I dynamically load html content of varying size. How do I know to adjust the width and height appropriately if autoHeight should be avoided?

    Molamini

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

    Default

    Please use Code tags in the future.

  5. #5
    Ext JS Premium Member
    Join Date
    Feb 2009
    Posts
    28

    Default getting the size of the HTML content...

    I talked to a colleague and he suggested using an invisible <IFRAME> to place the content, get the size of the <IFRAME> and then use those values to set the width and height of a panel.

    I don't know if this works (yet) but I'd at least like to offer a suggestion.

    M

  6. #6

    Default

    sometimes i use "clientWidth" etc in javascript to help me calculate the new size.
    you can inspect the dom element via firebug html => dom tab.
    be careful those attributes may have different meaning across different browsers.

Posting Permissions

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