首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Ext js 7现代折叠/调整面板大小

Ext js 7现代折叠/调整面板大小
EN

Stack Overflow用户
提问于 2021-03-18 15:40:03
回答 1查看 121关注 0票数 0

我还有另一个Extjs7现代布局问题,有多个大小调整和折叠,如下所示:https://fiddle.sencha.com/#view/editor&fiddle/3ci6

当我折叠"Move this first“面板,然后向左移动大小,然后向右移动大小时,出现了一个奇怪的布局错误( statistik右边的空白区域出现)。

我做错什么了?

EN

回答 1

Stack Overflow用户

发布于 2021-03-18 20:19:23

只需将大小调整移到上一个面板:

代码语言:javascript
复制
function __(key) {
    return key;
}

Ext.create('Ext.form.Panel', {
    xtype: 'main.customer',
    itemId: 'main_customer',

    renderTo: Ext.getBody(),

    //title: __('Kunde'),
    flex: 1,
    items: [{
        xtype: 'panel',
        itemId: 'maincontainer',
        //hidden: true,
        layout: {
            type: 'vbox',
            align: 'stretch'
        },
        flex: 1,
        height: '100%',
        items: [{
            xtype: 'panel',
            padding: 0,
            layout: {
                type: 'hbox',
                align: 'stretch'
            },
            flex: 1,
            height: '63%',
            resizable: {
                split: true,
                edges: ['south']
            },
            items: [{
                xtype: 'panel',
                layout: {
                    type: 'hbox',
                    align: 'stretch'
                },
                flex: 1,
                items: [{
                    xtype: 'panel',
                    layout: {
                        type: 'hbox',
                        align: 'stretch'
                    },
                    flex: 1,
                    items: [{
                        title: __('Stammdaten'),
                        xtype: 'panel',
                        html: 'test',
                        flex: 1,
                        collapsible: {
                            direction: 'left',
                            animation: false,
                            useDrawer: false,
                            collapseToolText: __('Stammdaten einklappen'),
                            expandToolText: __('Stammdaten ausklappen'),
                        },
                    }, {
                        xtype: 'panel',
                        title: __('Weitere Kundendaten'),
                        collapsed: true,
                        flex: 1,
                        collapsible: {
                            direction: 'right',
                            animation: false,
                            useDrawer: false,
                            collapseToolText: __('Weitere Kundendaten einklappen'),
                            expandToolText: __('Weitere Kundendaten ausklappen'),
                        },
                        layout: {
                            type: 'fit',
                            align: 'stretch'
                        },
                        items: [{
                            xtype: 'tabpanel',
                            flex: 1,
                            layout: {
                                animation: {
                                    type: '',
                                }
                            },
                            defaults: {
                                scrollable: true,
                                userSelectable: {
                                    bodyElement: true
                                },
                                padding: 10,
                            },
                            items: [{
                                title: __('Zusatz 1'),
                                iconCls: '',
                                flex: 1,
                                items: [{
                                    xtype: 'container',
                                    flex: 1,
                                    items: [{
                                        xtype: 'panel',
                                        flex: 1,
                                        html: 'test',
                                    }]
                                }]
                            }, {
                                title: __('Zusatz 2'),
                                iconCls: '',
                                flex: 1,
                                items: [{
                                    xtype: 'container',
                                    flex: 1,
                                    items: [{
                                        xtype: 'panel',
                                        flex: 1,
                                        html: 'test',
                                    }]
                                }]
                            }]
                        }]
                    }],
                }]
            }, {
                xtype: 'panel',
                resizable: {
                    split: true,
                    edges: ['west'],
                },
                layout: {
                    type: 'hbox',
                    align: 'stretch'
                },
                flex: 1,
                items: [{
                    xtype: 'panel',
                    flex: 1,
                    html: '< Move this first<br>then this one to the right >',
                    collapsible: {
                        direction: 'right',
                        animation: false,
                        useDrawer: false,
                        collapseToolText: __('Statistik einklappen'),
                        expandToolText: __('Statistik ausklappen'),
                    },
                    // THE RESIZER IS MOVED HERE
                    resizable: {
                        split: true,
                        edges: ['east'],
                    },
                }, {
                    xtype: 'panel',
                    title: __('Statistik'),
                    collapsible: {
                        direction: 'right',
                        animation: false,
                        useDrawer: false,
                        collapseToolText: __('Statistik einklappen'),
                        expandToolText: __('Statistik ausklappen'),
                    },
                    layout: {
                        type: 'hbox',
                        align: 'stretch'
                    },
                    flex: 1,
                    items: [{
                        xtype: 'tabpanel',
                        flex: 1,
                        layout: {
                            animation: {
                                type: '',
                            }
                        },
                        defaults: {
                            scrollable: true,
                            userSelectable: {
                                bodyElement: true
                            },
                            padding: 10,
                        },
                        items: [{
                            title: __('Umsatzstatistik'),
                            iconCls: '',
                            flex: 1,
                            items: [{
                                xtype: 'panel',
                                flex: 1,
                                items: [{
                                    //xtype: 'main.customer.basedata.statistik',
                                }]
                            }]
                        }, {
                            title: __('Weitere Statistik'),
                            iconCls: '',
                            flex: 1,
                            items: [{
                                xtype: 'container',
                                html: 'stats2',
                            }]
                        }]
                    }],
                    // ADDITIONAL LISTENERS
                    listeners: {
                        collapse: function (panel) {
                            panel.previousSibling().setResizable({})
                        },
                        expand: function (panel) {
                            panel.previousSibling().setResizable({
                                split: true,
                                edges: ['east'],
                            })
                        }
                    }
                }],
            }]
        }, {
            xtype: 'panel',
            layout: {
                type: 'hbox',
                align: 'stretch'
            },
            flex: 1,
            items: [{
                xtype: 'panel',
                width: '50%',
                resizable: {
                    split: true,
                    edges: 'east'
                },
                items: [{
                    xtype: 'panel',
                    html: 'test',
                }],
            }, {
                xtype: 'panel',
                flex: 1,
                items: [{
                    xtype: 'panel',
                    html: 'test',
                }],
            }]
        }]
    }],
    collapsible: false
});
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/66686657

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档