2

美好的一天,我是 extjs 新手,我正在使用 extjs 3,我的布局有问题,我有选项卡面板,选项卡 1 的内部将是视口,选项卡 2 只是一个简单的内容,但是当我点击tab2,视口没有消失,应该是视口只在选项卡1或第一个选项卡。以下是我的代码,请帮忙,如果我的代码有问题怎么办。

var Tabs;
var chatUi;
var content = "centerpanel";

var viewport1 = new Ext.Viewport({
    //id:       'chatUiLayout',
    layout: 'border',
    //renderTo :    'liveChatTextLiveHelp',
    items: [{
        width: 150,
        region: 'east',
        title: 'east'
    }, {
        region: 'center',
        title: 'center'
    }]
});


Tabs = new Ext.TabPanel({
    id: 'liveChatTextLiveHelp',
    renderTo: 'div-live-chat',
    activeTab: 0,
    //region:       'center',
    //hieght:       200,
    plain: true,
    items: [{
        title: 'Live help',
        items: [ //viewport1  
        ],
        html: "<div id='" + content + "' class='90pers' ></div>"
    }, {
        title: 'Tab 2',
        html: "tab 2 content"
    }

    ],
    scope: this,
    listeners: {
        afterrender: function () {
            viewport1.render(content);
        },
        scope: this

    }

});
4

2 回答 2

6

视口是代表整个浏览器窗口的特殊容器。他们总是将自己呈现给身体,使他们成为进入其他事物的不良候选人。而不是视口,您应该尝试使用panelor container

于 2012-09-27T01:52:14.297 回答
0

您可能正在选项卡 1 中寻找边框布局,类似于Windows with Layouts example
视口无法隐藏,因为它绑定到浏览器窗口。

于 2012-09-28T06:37:05.487 回答