Sencha Touch -隐藏项目在标签栏

Sencha Touch - Hide Item in TabBar

本文关键字:标签栏 项目 隐藏 Touch Sencha      更新时间:2023-09-26

我想隐藏标签栏中的ThankYou项,直到用户提交联系我们表单。提交表单后,我希望显示ThankYou项,而隐藏其他三个项。这可能吗?下面是我的代码:

Mobile.views.ViewPort = Ext.extend(Ext.TabPanel, {
    fullscreen: true,
    layout: 'card',
    tabBar: {
                layout: { pack: 'center' }
            },
    items: [
        {
            xtype: 'Landing'
        },
        {
            xtype: 'AboutUs'
        },
        {
            xtype: 'ContactUs'
        },
        {
            id: 'ThankYou',
            name: 'ThankYou',
            xtype: 'ThankYou',
            hidden: true //Not working
        }
    ]
});

不要在TabPanel中包含ThankYou面板,而是使用一个您将在用户提交表单后设置显示(使用show())的Sheet。

或者,如果你想使用TabPanel,不要在items数组中包含ThankYou面板,一旦你提交了表单,做:

Mobile.views.ViewPort.setActiveItem(new Mobile.views.ThankYou(),animationOptions);