Results 1 to 8 of 8

Thread: Ext.Window as child of Panel

  1. #1

    Question Ext.Window as child of Panel

    I have a panel set as the center of a viewport layout, and I am creating Ext.Windows as items in this panel (with constrain = true). However, the constrain does not function properly until the window is resized. Also, when the window is first resized, the window shadows get messed up.

    The problem can be seen at http://power-user-tools.no-ip.org, but I created a smaller test case at http://power-user-tools.no-ip.org/test.html.

    Much obliged for your help, thanks!

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

    Default

    Windows are floating and cannot be child items.

    Just render the Window to the Panel's body.

  3. #3
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,245

    Default

    Actually, you can use windows as child items, e.g.
    Code:
    new Ext.Panel({
        title: 'Panel',
        width: 500,
        height: 500,
        layout: 'absolute',
        items: {
            xtype: 'window',
            title: 'Window',
            x: 100,
            y: 100,
            width: 200,
            height: 200,
            constrain: true,
            initHidden: false,
            shadow: false
        },
        renderTo: Ext.getBody()
    });
    (I did have to disable the shadow, because it was initially misaligned)

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

    Default

    Yes, in a layout: 'absolute' Container. But I'm not sure posting a working "coincidence" is a good idea. That code will be cargo culted, and people will be adding Windows to border layouts and quacking about how they don't work.

  5. #5
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,245

    Default

    Quote Originally Posted by Animal View Post
    Yes, in a layout: 'absolute' Container. But I'm not sure posting a working "coincidence" is a good idea. That code will be cargo culted, and people will be adding Windows to border layouts and quacking about how they don't work.
    IIRC you posted a feature request that floating items should only be rendered but not layed out by the various layouts.

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

    Default

    Yes, floating: true child items could be rendered with no special layout sizing/positioning done which would make things easier for everyone.

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

    Default

    The proposal

    http://www.extjs.com/forum/showthread.php?t=80943

    The concept of getItems to gather all renderable items is already being added, so this could work.

  8. #8

    Default

    Thanks for the help Animal, I got it working by calling win.render(Ext.getCmp('contentPanel').body);

    However, the docs are a bit misleading:
    To constrain a Window to another element specify renderTo.
    I could not get this to work by just setting renderTo; I had to call render specifically.

Posting Permissions

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