PDA

View Full Version : Load local HTML page in Tabpanel



sudeepcm
15 Sep 2010, 7:15 AM
Hi,
I am new to the Ext-js. So don't know whether the answer for this question is already available in this forum or not.
I have a TabPanel in my html page

TabPanel
--------------
var tabPanel = new Ext.TabPanel({
id:'doc-body',
region:'center',
margins:'0 5 5 0',
resizeTabs: true,
minTabWidth: 135,
tabWidth: 135,
plugins: new Ext.ux.TabCloseMenu(),
enableTabScroll: true,
activeTab: 0
});
And I wanted add a new tab in to the Tabpanel using the following method.

addTab Method
-------------
function addTab(tabTitle, targetUrl){
tabPanel.add({
title: tabTitle,
iconCls: 'tabs',
autoLoad: {url: targetUrl, callback: this.initSearch, scope: this},
closable:true
}).show();
}
Call 'addTab('Welcome Page','./welcome.html')' method will add a tab to the tabpanel , but it will not load the page.
'welcome.html' is a local page and it's content is a simple paragraph as shown below.

welcome.html
--------------
<p>Welcome<p>

Thanks in advance for ur help.

MrSparks
15 Sep 2010, 7:23 AM
I'm 99% sure you need to use ManagedIFrame to load external HTML content. At least that's the only way I managed to get it to work.

See: http://www.sencha.com/forum/showthread.php?104484-TabPanel-Dynamic-Content-deferredRender&p=490011#post490011 (http://www.sencha.com/forum/showthread.php?104484-TabPanel-Dynamic-Content-deferredRender&p=490011#post490011)

sudeepcm
16 Sep 2010, 10:09 PM
Thanks for ur reply..=D> i will try this..

sudeepcm
29 Sep 2010, 11:26 PM
I tried with ManagedIFrame..and it was success.. thanku..............