问题描述如:http://www.iteye.com/problems/37452
解决代码就是给iframe页面中的panel添加个id:'PanelLayout',Tabpanel切换时查找iframe然后用Ext.getCmp('PanelLayout').doLayout();
主要代码:
Ext.onReady(function() { tabs = new Ext.TabPanel({ enableTabScroll : true }); tabs.on('tabchange',function(tp,p){ var frames=Ext.select('iframe'); frames.each(function(item){ var temp = item.dom.contentWindow; if(temp&&!Ext.isEmpty(temp.Ext)&&!Ext.isEmpty(temp.Ext.get('PanelLayout'))) temp.Ext.getCmp('PanelLayout').doLayout(); }); }); addTab = function(title, url) { tabs.add({ title : title, iconCls : 'tabs', contentEl : Ext.DomHelper.append(document.body, { tag : 'iframe', style : "border 0px none;scrollbar:true", src : url, height : "100%", width : "100%" }) }).show(); } new Ext.Viewport({ layout : 'fit', items : [tabs] }) });