Results 1 to 2 of 2

Thread: BorderLayout resize problem

  1. #1
    Sencha User
    Join Date
    Aug 2009
    Posts
    63

    Default BorderLayout resize problem

    I'm trying to resize a Panel in a north region of BorderLayout. The Panel is resized, but the center region doesn't refresh to get your new size, so my north Panel isn't fully showed on Window. Here's the code to simulate the problem:

    Code:
    Ext.onReady(function() {
        
        var btn = new Ext.Button({
            title : 'Panel 1',
            xtype : "button",
            text : "Resize",
            height : 20,
            region : "north"
        });
        
        btn.on('click', function() {
            this.setHeight(100);
        }, btn);
    
        var window = new Ext.Window({
            layout : "border",
            height : 300,
            width : 300,
            defaults : {
                frame : true,
            },
            items : [btn,{
                title : 'Panel 2',
                height : 100,
                width : 100,
                region : "center"
            }]
        });
        window.show();
    });
    Anyone knows how to solve it?

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

    Default

    You have to ask the Container to re layout its child items. doLayout

    BTW, you are not resizing a Panel. You are resizing the Button. The Button is the north region if you read your code.

Similar Threads

  1. Replies: 25
    Last Post: 8 Jan 2009, 7:37 PM
  2. [SOLVED] BorderLayout and Resize
    By rmunoz in forum Ext 1.x: Help & Discussion
    Replies: 4
    Last Post: 12 Jul 2007, 1:33 AM
  3. How to resize BorderLayout?
    By dragonfly in forum Ext 1.x: Help & Discussion
    Replies: 0
    Last Post: 17 May 2007, 9:15 PM
  4. Need Help With BorderLayout Resize
    By dangerzone in forum Ext 1.x: Help & Discussion
    Replies: 1
    Last Post: 14 Feb 2007, 1:54 PM
  5. BorderLayout resize
    By barrygently in forum Ext 1.x: Bugs
    Replies: 0
    Last Post: 28 Nov 2006, 5:08 PM

Posting Permissions

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