Results 1 to 8 of 8

Thread: Some weird accordion layout behavior (ext 3.0)

  1. #1
    Ext JS Premium Member
    Join Date
    Mar 2008
    Location
    Moscow
    Posts
    137

    Default Some weird accordion layout behavior (ext 3.0)

    I have this configuration for my application main viewport, in ExtJs 2.3.0 it looks and feels great, everything works perfect

    Code:
    new Ext.Viewport({
                    id: 'main-viewport',
                    layout: 'border',
                    items: [{
                        region: 'north',
                        contentEl: 'north',
                        height: 0
                    }, {
                        region: 'south',
                        contentEl: 'south',
                        split: true,
                        height: 100,
                        minSize: 100,
                        maxSize: 200,
                        collapsible: true,
                        collapsed: true,
                        title: 'Status',
                        margins: '0 0 0 0'
                    }, {
                        region: 'west',
                        contentEl: 'west',
                        title: 'Navigation',
                        split: true,
                        width: 250,
                        minSize: 175,
                        maxSize: 400,
                        collapsible: true,
                        margins: '0 0 0 5',
                        layout: 'accordion',
                        iconCls: 'nav',
                        layoutConfig: {
                            animate: true
                        },
                        items: [{
                            layout: 'fit',
                            title: '???????????',
                            border: false,
                            tools: [{ id: 'refresh', handler: function() { PlatformTools.RefreshTree('tree-dictionaries'); } }],
                            items: [new Ext.tree.TreePanel({
                                id: 'tree-dictionaries',
                                layout: 'fit',
                                region: 'west',
                                margins:'0 0 5 5',
                                cmargins:'0 0 0 0',
                                split:true,
                                lines: false,
                                rootVisible: false,
                                autoScroll: true,
                                animCollapse:false,
                                animate: false,
                                collapseMode:'mini',
                                containerScroll: true,
                                loader: new Ext.tree.TreeLoader({
                                    preloadChildren: true,
                                    dataUrl: 'Service/MenuTrees.aspx?tree=Reference',
                                    listeners: {
                                        loadexception: function(tree, node, response){
    
                                            PlatformTools.CheckMenuLogin(response, 'tree-dictionaries');
                                        }
                                    }
                                }),
                                root: new Ext.tree.AsyncTreeNode({
                                    text: 'Root',
                                    id: 'RootFolder',
                                    expanded: true
                                })
                            })]
                        },{
                            layout: 'fit',
                            title: '?????????',
                            border: false,
                            tools: [{ id: 'refresh', handler: function() { PlatformTools.RefreshTree('tree-documents'); } }],
                            items: [new Ext.tree.TreePanel({
                                id: 'tree-documents',
                                layout: 'fit',
                                region: 'west',
                                useArrows: true,
                                lines: false,
                                rootVisible: false,
                                autoScroll: true,
                                animate: true,
                                border: false,
                                containerScroll: true,
                                loader: new Ext.tree.TreeLoader({
                                    preloadChildren: true,
                                    dataUrl: 'Service/MenuTrees.aspx?documents=true',
                                    listeners: {
                                        loadexception: function(tree, node, response){
                                        
                                            PlatformTools.CheckMenuLogin(response, 'tree-documents');
                                        }
                                    }
                                }),
                                root: new Ext.tree.AsyncTreeNode({
                                    text: 'Root',
                                    id: 'RootFolder',
                                    expanded: true
                                })
                            })]
                        },{
                            layout: 'fit',
                            title: '???',
                            border: false,
                            tools: [{ id: 'refresh', handler: function() { PlatformTools.RefreshTree('tree-arm'); } }],
                            items: [new Ext.tree.TreePanel({
                                id: 'tree-arm',
                                layout: 'fit',
                                region: 'west',
                                useArrows: true,
                                lines: false,
                                rootVisible: false,
                                autoScroll: true,
                                animate: true,
                                border: false,
                                containerScroll: true,
                                loader: new Ext.tree.TreeLoader({
                                    preloadChildren: true,
                                    dataUrl: 'Service/MenuTrees.aspx?arm=true',
                                    listeners: {
                                        loadexception: function(tree, node, response){
                                        
                                            PlatformTools.CheckMenuLogin(response, 'tree-arm');
                                        }
                                    }
                                }),
                                root: new Ext.tree.AsyncTreeNode({
                                    text: 'Root',
                                    id: 'RootFolder',
                                    expanded: true
                                })
                            })]
                        }
                        ]
                    },
                     {
                        region: 'east',
                        contentEl: 'east',
                        title: 'System settings',
                        collapsible: true,
                        collapsed: true,
                        split: true,
                        width: 225,
                        minSize: 175,
                        maxSize: 400,
                        layout: 'fit',
                        margins: '0 5 0 0',
                        iconCls: 'settings'
                    }, {
                        xtype : 'tabpanel',
                        region: 'center',
                        id: 'center-panel',
                        margins: '3 3 3 3',
                        tabWidth: 135,
                        enableTabScroll: true,
                        layoutOnTabChange : true,
                        activeTab: 0,
                        defaults:
                        {
                        autoScroll: true,
                        closable: true
                        }
                    }]
                });
    But, same code with ExtJS 3.0 makes this :


    and if all collapsed, looks like this:


    What am I doing wrong? Can anyone tell me?

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

    Default

    Are you using the ManagedIframe user extension? Did you also upgrade that?

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

    Default

    use

    Code:
    layout: {
        type: 'accordion',
        autoWidth: false
    },

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

    Default

    But why are you embedding each operational Panel inside a layout: 'fit' wrapping Panel?

    Unwrap them! Use them as immediate children of the accordion.

  5. #5
    Ext JS Premium Member
    Join Date
    Mar 2008
    Location
    Moscow
    Posts
    137

    Question

    Thanks for replying... After cleaning up a little bit it looks like this :
    Code:
    new Ext.Viewport({
                    id: 'main-viewport',
                    layout: 'border',
                    items: [{
                        region: 'north',
                        contentEl: 'north',
                        height: 0
                    }, {
                        title: '?????????',
                        region: 'south',
                        contentEl: 'south',
                        height: 100,
                        minSize: 100,
                        maxSize: 200,
                        collapsible: true,
                        collapsed: true
                    }, {
                        title: '?????????',
                        region: 'west',
                        contentEl: 'west',
                        width: 250,
                        minSize: 175,
                        maxSize: 400,
                        split: true,
                        collapsible: true,
                        layout: 'accordion',
                        layoutConfig: {
                            animate : false
                        },
                        items: [
                            new Ext.tree.TreePanel({
                                title: '???????????',
                                id: 'tree-dictionaries',
                                rootVisible: false,
                                autoScroll: true,
                                lines: false,
                                tools: [{ id: 'refresh', handler: function() { PlatformTools.RefreshTree('tree-dictionaries'); } }],
                                loader: new Ext.tree.TreeLoader({
                                    preloadChildren: true,
                                    dataUrl: 'Service/MenuTrees.aspx?tree=Reference',
                                    listeners: {
                                        loadexception: function(tree, node, response){
    
                                            PlatformTools.CheckMenuLogin(response, 'tree-dictionaries');
                                        }
                                    }
                                }),
                                root: new Ext.tree.AsyncTreeNode({
                                    id: 'RootFolder',
                                    text: 'Root'
                                })
                            }),
                            
                            new Ext.tree.TreePanel({
                                title: '?????????',
                                id: 'tree-documents',
                                rootVisible: false,
                                autoScroll: true,
                                lines: false,
                                tools: [{ id: 'refresh', handler: function() { PlatformTools.RefreshTree('tree-documents'); } }],
                                loader: new Ext.tree.TreeLoader({
                                    preloadChildren: true,
                                    dataUrl: 'Service/MenuTrees.aspx?documents=true',
                                    listeners: {
                                        loadexception: function(tree, node, response){
                                        
                                            PlatformTools.CheckMenuLogin(response, 'tree-documents');
                                        }
                                    }
                                }),
                                root: new Ext.tree.AsyncTreeNode({
                                    id: 'RootFolder',
                                    text: 'Root'
                                })
                            }),
                            
                            new Ext.tree.TreePanel({
                                title: '???',
                                id: 'tree-arm',
                                rootVisible: false,
                                autoScroll: true,
                                lines: false,
                                tools: [{ id: 'refresh', handler: function() { PlatformTools.RefreshTree('tree-arm'); } }],
                                loader: new Ext.tree.TreeLoader({
                                    preloadChildren: true,
                                    dataUrl: 'Service/MenuTrees.aspx?arm=true',
                                    listeners: {
                                        loadexception: function(tree, node, response){
                                        
                                            PlatformTools.CheckMenuLogin(response, 'tree-arm');
                                        }
                                    }
                                }),
                                root: new Ext.tree.AsyncTreeNode({
                                    id: 'RootFolder',
                                    text: 'Root'
                                })
                            }),
                            
                            new Ext.tree.TreePanel({
                                title: '??????',
                                id: 'tree-reports',
                                rootVisible: false,
                                autoScroll: true,
                                lines: false,
                                tools: [{ id: 'refresh', handler: function() { PlatformTools.RefreshTree('tree-reports'); } }],
                                loader: new Ext.tree.TreeLoader({
                                    preloadChildren: true,
                                    dataUrl: 'Service/MenuTrees.aspx?reports=true',
                                    listeners: {
                                        loadexception: function(tree, node, response){
                                        
                                            PlatformTools.CheckMenuLogin(response, 'tree-reports');
                                        }
                                    }
                                }),
                                root: new Ext.tree.AsyncTreeNode({
                                    id: 'RootFolder',
                                    text: 'Root'
                                })
                            })]
                    },
                     {
                        region: 'east',
                        contentEl: 'east',
                        title: 'C???????? ?????????',
                        collapsible: true,
                        collapsed: true,
                        width: 225,
                        minSize: 175,
                        maxSize: 400
                    }, {
                        xtype : 'tabpanel',
                        region: 'center',
                        id: 'center-panel',
                        tabWidth: 135,
                        enableTabScroll: true,
                        layoutOnTabChange : true,
                        activeTab: 0,
                        plugins: new Ext.platform.TabCloseMenu(),
                        defaults: {
                                    autoScroll: true,
                                    closable: true
                                  }
                    }]
                })
    but nothing really changed in behaviour...

  6. #6
    Ext JS Premium Member
    Join Date
    Mar 2008
    Location
    Moscow
    Posts
    137

    Default

    Condor, I use ManagedIFrame only to show reports. And I've already updated that component.

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

    Default

    Quote Originally Posted by Chemist View Post
    Condor, I use ManagedIFrame only to show reports. And I've already updated that component.
    Are you sure you upgraded correctly?

    The 'collapsed panel still takes up space' error is usually caused by using an older MIF version.

  8. #8
    Ext JS Premium Member
    Join Date
    Mar 2008
    Location
    Moscow
    Posts
    137

    Default

    Thanks Condor, I've just got RC3 of the Mif and it helped! For now it all works perfect!

    everything fixed.

Posting Permissions

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