0

我正在尝试将以下选项卡添加到以下面板,位于面板的顶部和底部工具栏之间。这可能吗?您能否举例说明如何组合这两个文件?

谢谢你的帮助!

控制板:

Ext.define('Myapp.view.Product', {
    extend: 'Ext.form.Panel',
    id: 'productCard',

    config: {
        modal: true,
        hideOnMaskTap: false,
        centered: true,
        height: '95%',
        width: '98%',
        items: [
            {
                docked: 'top',
                xtype: 'toolbar',
                title: '',
                id: 'productTitle'
            },
            {
                docked: 'bottom',
                xtype: 'toolbar',
                items: [
                    {
                        text: 'Close',
                        ui: 'back',
                        id: 'closeProductCard'
                    }
                ]
            }
        ]
    }
});

标签

Ext.define('Myapp.view.Tabs', {
extend: 'Ext.tab.Panel',
    requires: [
        'Ext.field.Toggle'
    ],

    config: {
        activeItem: 0,
        tabBar: {
            docked: 'top',
            autoScroll: 'auto',
            ui: 'neutral',
            layout: {
                pack: 'center'
            }
        },
        items: [
            {
                title: 'Tab 1',
                xtype: 'formpanel',
                items: [
                    {
                        xtype: 'fieldset',
                        defaults: {
                            labelWidth: '35%',
                            labelAlign: 'top'
                        },
                        items: [
                            {
                                xtype: 'togglefield',
                                name: 'toggle',
                                label: 'Toggle'
                            }
                        ]
                    }
                ]
            },
            {
                title: 'Tab 2',
                xtype: 'formpanel',
                items: [
                    {
                        xtype: 'fieldset',
                        defaults: {
                            labelWidth: '35%',
                            labelAlign: 'top'
                        },
                        items: [
                            {
                                xtype: 'togglefield',
                                name: 'toggle',
                                label: 'Toggle'
                            }
                        ]
                    }
                ]
            }
        ]
    }
});
4

1 回答 1

0
Ext.define('Myapp.view.Product', {
    extend: 'Ext.tab.Panel',
    requires: [
    'Ext.field.Toggle'
    ],

    config: {
        activeItem: 0,
        tabBar: {
            docked: 'top',
            autoScroll: 'auto',
            ui: 'neutral',
            layout: {
                pack: 'center'
            }
        },
        items: [{
            xtype:'toolbar',
            docked:'top'
        }, {
            docked: 'bottom',
            xtype: 'toolbar',
            items: [
            {
                text: 'Close',
                ui: 'back',
                id: 'closeProductCard'
            }
            ]
        },
        {
            title: 'Tab 1',
            xtype: 'formpanel',
            items: [{
                xtype: 'fieldset',
                defaults: {
                    labelWidth: '35%',
                    labelAlign: 'top'
                },
                items: [{
                    xtype: 'togglefield',
                    name: 'toggle',
                    label: 'Toggle'
                }
                ]
            }
            ]
        },{
            title: 'Tab 2',
            xtype: 'formpanel',
            items: [{
                xtype: 'fieldset',
                defaults: {
                    labelWidth: '35%',
                    labelAlign: 'top'
                },
                items: [{
                    xtype: 'togglefield',
                    name: 'toggle',
                    label: 'Toggle'
                }
                ]
            }
            ]
        }
        ]
    }
});

好的,我将两个视图合并到产品视图中。这将显示带有顶部和底部工具栏的选项卡面板。希望这仍然适用于它作为详细信息页面的动态

于 2012-04-05T21:55:55.900 回答