Sencha 触摸面板内部面板不显示

发布于 2024-12-10 13:57:52 字数 1639 浏览 1 评论 0原文

我在面板内有一个面板作为一个项目,以及其他停靠的项目。 由于某种原因它没有出现。 这些是要添加到主面板的内容:

    MarketMakerApp.views.businessInfo = new Ext.Panel({
        id: 'businessInfo',
        layout: 'fit',
        html: '<br /><br /><br /><div>{ id } </div>' + '<div>{ title }</div>'
        //html: 'This is the business info view'
    });

     MarketMakerApp.views.businessTabbar = new Ext.TabBar({
        dock: 'bottom',
        ui: 'dark',
        items: [
            {
                text: '1',
                iconCls: 'info',
                hander: function() {
                    MarketMakerApp.views.viewport.setActiveItem('businessInfo', {type: 'slide', direction: 'left' });
                }
            },
            {
                text: '2',
                iconCls: 'star',
                hander: function() {
                    this.add( MarketMakerApp.views.businessInfo);
                    this.setActiveItem(2);
                }
            },
            {
                text: '3',
                iconCls: 'map',
                hander: function() {
                }
            }
        ]
    });

主面板是这样的:

    MarketMakerApp.views.businessContainer = new Ext.Panel({
        id: 'businessContainer',
        layout: 'fit',
        dockedItems: [
            MarketMakerApp.views.businessTypeListToolbar,
            MarketMakerApp.views.businessTabbar
        ],
        items: [ MarketMakerApp.views.businessInfo]
    });

选项卡栏和工具栏显示正常,但我看不到 BusinessInfo 面板。 任何建议将不胜感激。

ps 我在 Tabpanel 上挣扎了太久,以至于无法放弃,现在只使用 tabbar。

I have a panel inside a panel as an item, along with other docked items.
For some reason it is not showing up.
These are stuffs to add to main panel:

    MarketMakerApp.views.businessInfo = new Ext.Panel({
        id: 'businessInfo',
        layout: 'fit',
        html: '<br /><br /><br /><div>{ id } </div>' + '<div>{ title }</div>'
        //html: 'This is the business info view'
    });

     MarketMakerApp.views.businessTabbar = new Ext.TabBar({
        dock: 'bottom',
        ui: 'dark',
        items: [
            {
                text: '1',
                iconCls: 'info',
                hander: function() {
                    MarketMakerApp.views.viewport.setActiveItem('businessInfo', {type: 'slide', direction: 'left' });
                }
            },
            {
                text: '2',
                iconCls: 'star',
                hander: function() {
                    this.add( MarketMakerApp.views.businessInfo);
                    this.setActiveItem(2);
                }
            },
            {
                text: '3',
                iconCls: 'map',
                hander: function() {
                }
            }
        ]
    });

And the main panel is this:

    MarketMakerApp.views.businessContainer = new Ext.Panel({
        id: 'businessContainer',
        layout: 'fit',
        dockedItems: [
            MarketMakerApp.views.businessTypeListToolbar,
            MarketMakerApp.views.businessTabbar
        ],
        items: [ MarketMakerApp.views.businessInfo]
    });

The tabbar and toolbar are showing up fine, but I can't see the businessInfo panel.
Any suggestions would be appreciated.

p.s. I struggled with Tabpanel far too long to give up and just using tabbar now.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

何处潇湘 2024-12-17 13:57:52

我在以编程方式创建面板(或无论您的观点是什么)方面没有取得任何成功。不过,这里有一些确实可以使用该方法的代码。

将 initComponent 函数添加到您的businessContainer,如下所示,而不是在businessContainer面板上设置项目:

initComponent: function(){
    Ext.apply(this, {
        items: [
            MarketMakerApp.views.businessInfo
        ]
    });
    MarketMakerApp.views.businessContainer.superclass.initComponent.apply(this, arguments);
}

I haven't had any success in creating Panels (or whatever your view is) programmatically like that. Here's some code that does work w/that approach though.

Add an initComponent function to your businessContainer like the following instead of setting the items on the businessContainer panel:

initComponent: function(){
    Ext.apply(this, {
        items: [
            MarketMakerApp.views.businessInfo
        ]
    });
    MarketMakerApp.views.businessContainer.superclass.initComponent.apply(this, arguments);
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文