1. #1
    Ext User
    Join Date
    May 2008
    Posts
    5
    Vote Rating
    0
    jbjorgen is on a distinguished road

      0  

    Default [2.2.1]Title bar does not collapse in border layout

    [2.2.1]Title bar does not collapse in border layout


    In this case, the titlebar of the south panel does not collapse, even though the panel itself collapses.

    Code:
    Ext.BLANK_IMAGE_URL = '/ext/resources/images/default/s.gif';
    Ext.namespace('MyApp', 'MyApp.Home');
    
    MyApp.Home.ModifyLayout = Ext.extend(Ext.Panel, {
        region:'south',  
        title:'Modify Layout',
        split:true,
        collapsible: true,
        collapsed: true,    
        layout:'form',
        height: 150,
        initComponent: function() {       
            this.items = [{ xtype: 'panel', border: false, html: 'test' }]
            MyApp.Home.ModifyLayout.superclass.initComponent.apply(this, arguments);
        }
    });
    Ext.reg('home-modify-layout', MyApp.Home.ModifyLayout);
    
    MyApp.Home.Main = Ext.extend(Ext.Panel, {
        id: 'home-main',
        layout:'border',
        title: 'Home',
        initComponent: function() {
            this.items = [{xtype: 'home-modify-layout'}, {xtype: 'panel', region:'center'}];
            MyApp.Home.Main.superclass.initComponent.apply(this, arguments);
        }
    });
    Ext.reg('home-main', MyApp.Home.Main);
    
    Ext.onReady(function() {             
        MyApp.Viewport = new Ext.Viewport({layout: 'fit', items: [{xtype: 'home-main'}], renderTo: Ext.getBody()}); 
    });
    Sample of bug here

  2. #2
    Ext User
    Join Date
    May 2008
    Posts
    5
    Vote Rating
    0
    jbjorgen is on a distinguished road

      0  

    Default


    Interestingly enough, the following code, which should produce the EXACT same thing, works fine.

    Code:
    Ext.BLANK_IMAGE_URL = '/ext/resources/images/default/s.gif';
    Ext.namespace('MyApp', 'MyApp.Home');
    
    Ext.onReady(function() {             
        MyApp.Viewport = new Ext.Viewport({
            layout: 'fit', 
            items: [{
                id: 'home-main',
                layout:'border',
                title: 'Home',
                items: [{
                    region:'south',  
                    title:'Modify Layout',
                    split:true,
                    collapsible: true,
                    collapsed: true,    
                    layout:'form',
                    height: 150,
                    items: [{ 
                        xtype: 'panel', 
                        border: false, 
                        html: 'test' 
                    }]        
                }, {
                    xtype: 'panel', region:'center'
                }]        
            }], 
            renderTo: Ext.getBody()
        }); 
    });

  3. #3
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,779
    Vote Rating
    598
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    Don't specify the region in the object prototype.

    Code:
    MyApp.Home.ModifyLayout = Ext.extend(Ext.Panel, {
        region:'south',  
        title:'Modify Layout',
        split:true,
        collapsible: true,
        collapsed: true,    
        layout:'form',
        height: 150,
        initComponent: function() {       
            this.items = [{ xtype: 'panel', border: false, html: 'test' }]
            MyApp.Home.ModifyLayout.superclass.initComponent.apply(this, arguments);
        }
    });
    Ext.reg('home-modify-layout', MyApp.Home.ModifyLayout);
    
    MyApp.Home.Main = Ext.extend(Ext.Panel, {
        id: 'home-main',
        layout:'border',
        title: 'Home',
        initComponent: function() {
            this.items = [{xtype: 'home-modify-layout', region: 'south'}, {xtype: 'panel', region:'center'}];
            MyApp.Home.Main.superclass.initComponent.apply(this, arguments);
        }
    });
    Ext.reg('home-main', MyApp.Home.Main);
    
    Ext.onReady(function() {             
        MyApp.Viewport = new Ext.Viewport({layout: 'fit', items: [{xtype: 'home-main'}], renderTo: Ext.getBody()}); 
    });
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  4. #4
    Ext User
    Join Date
    May 2008
    Posts
    5
    Vote Rating
    0
    jbjorgen is on a distinguished road

      0  

    Default


    Good try. Online demo has been updated to reflect changes with no apparent effect.

  5. #5
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,498
    Vote Rating
    46
    Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    It's still an extend to configure problem.

    The border layout class reads a lot of things from a region's initialConfig property, which means that the constructor must have been sent the configuration.

  6. #6
    Ext User
    Join Date
    May 2008
    Posts
    5
    Vote Rating
    0
    jbjorgen is on a distinguished road

      0  

    Default


    Quote Originally Posted by Animal View Post
    It's still an extend to configure problem.

    The border layout class reads a lot of things from a region's initialConfig property, which means that the constructor must have been sent the configuration.
    Not sure I follow all that (or that it was even a reply to me). What I think you're saying is "yes...that is indeed a bug", no?

  7. #7
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,498
    Vote Rating
    46
    Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    No. Not a bug.

    The layout uses the region's initialConfig.

    Stuff in the prototype won't get seen.

    Like collapsible

  8. #8

  9. #9
    Ext User
    Join Date
    May 2008
    Posts
    5
    Vote Rating
    0
    jbjorgen is on a distinguished road

      0  

    Default


    Ah. Thanks for clearing that up. I apologize for my slowness.

Thread Participants: 2