scoobasteve1982
27 Jul 2007, 9:56 AM
Hi there. Okay so it took me about 8 hours to finally get my code working to dynamically generate tabs in a center content panel (and it shouldnt have taken that long btw lol). However, I can only seem to load a local file and not a remote url (i.e. Google or some other page). Below is the code that I'm using to create the dynamic tab.
...
openTab: function(config)
{
var newPanel;
//create div by hand instead of using autoCreate
Ext.DomHelper.append('center-div', {
tag:'div',
cls: 'dynamicTab',
id:config.id
});
newPanel = new Ext.ContentPanel(config.id, {
title: 'Tab Title',
closable: true,
autoScroll: true,
fitToFrame:true,
//url:'http://www.google.com'
});
newPanel.load({
url:'http://www.google.com',
params: config.params,
discardUrl: true,
nocache: true,
text: "Tester",
timeout: 30,
closeable: true,
scripts: true
});
mainLayout.getRegion('center').add(newPanel);
} //end openTab
Any thoughts? If this isn't enough code please let me know and I'll post more. Also, the little X so that I can close the tabs aren't displayed. Any ideas? I was considering maybe putting an iframe in the tab so that remote URL could be loaded in the panel. :-/:-/ Thanks for any help you can provide.
...
openTab: function(config)
{
var newPanel;
//create div by hand instead of using autoCreate
Ext.DomHelper.append('center-div', {
tag:'div',
cls: 'dynamicTab',
id:config.id
});
newPanel = new Ext.ContentPanel(config.id, {
title: 'Tab Title',
closable: true,
autoScroll: true,
fitToFrame:true,
//url:'http://www.google.com'
});
newPanel.load({
url:'http://www.google.com',
params: config.params,
discardUrl: true,
nocache: true,
text: "Tester",
timeout: 30,
closeable: true,
scripts: true
});
mainLayout.getRegion('center').add(newPanel);
} //end openTab
Any thoughts? If this isn't enough code please let me know and I'll post more. Also, the little X so that I can close the tabs aren't displayed. Any ideas? I was considering maybe putting an iframe in the tab so that remote URL could be loaded in the panel. :-/:-/ Thanks for any help you can provide.