2 andy90914041 Andy90914041 于 2013.11.28 12:21 提问

ExtJS 3.4 tabpanel 刷新问题

主要代码如下,bug:tabPanel打开一个panel,关闭,在打开另一个panel,tabpanel中还是原来那个panel,怎么回事,请高手帮看看!
function init() {
var numBindPanel = null;
var RegSTBPanel = null;
var ConfPanel = null;
var north = new Ext.Panel({
region : 'north',
height : 120,
border : false,
margins : '0 0 15 0',
bodyStyle : {
background : 'url(resources/header.jpg)',
padding : '10px'
},
bbar : [ {
text : '号码绑定',
handler : function() {
if (!numBindPanel) {
numBindPanel = new Ext.vc.NumBindPanel();
}
var n = center.getComponent(numBindPanel);
if (!n) {
center.add(numBindPanel);
}
center.setActiveTab(numBindPanel);
numBindPanel.getUpdater().refresh();
center.doLayout();
}
}, '-', {
text : '注册STB',
handler : function() {
if (!RegSTBPanel) {
RegSTBPanel = new Ext.vc.RegSTBPanel();
}
var n = center.getComponent(RegSTBPanel);
if (!n) {
center.add(RegSTBPanel);
}
center.setActiveTab(RegSTBPanel);
center.doLayout();
}
}, '-', {
text : '会议定制',
handler : function() {

            if (!ConfPanel) {
                ConfPanel = new Ext.vc.ConfPanel();
            }
            var n = center.getComponent(ConfPanel);
            if (!n) {
                center.add(ConfPanel);
            }
            center.setActiveTab(ConfPanel);
            ConfPanel.getUpdater().refresh();
            center.doLayout();
        }
    }, '->', {
        xtype : "label",
        id : "currentUser",
        text : 'Admin'
    }, '-', {
        text : '退出',
        handler : function() {
            Ext.Msg.alert('info', 'admin-logout');
        }
    } ]
});
var south = new Ext.Panel({
    region : 'south',
    html : '<div style="text-align:center">VideoConnect</div>',
    autoHeight : true,
    border : false,
    margins : '5 0 0 0'
});
var center = new Ext.TabPanel({
    title : 'center Region is resizable',
    region : 'center',
    frame : true,
    activeTab : 0,
    autoDestroy : false,
    items : [ {
        title : 'info',
        html : 'about'
    } ],
    listeners : {
    }
});


Ext.util.CSS.swapStyleSheet('theme',
        '/plugins/ext-3.4.1/resources/css/xtheme-access.css');


new Ext.Viewport({
    layout : 'border',
    items : [ north, south, center ]
});

}
Ext.onReady(init);

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!