watrboy00
26 Sep 2007, 5:55 PM
I have a BorderLayout with north, center, and south regions. The center region is tabbed and by default is loaded with 3 ContentPanels with urls specified on creation. My problem is every time the 'home' is clicked it reloads the panel even though loadOnce is set to true on that ContentPanel. Any ideas why it does this?
var Layout = function() {
var layout;
var north;
var center_issues;
var center_home;
var center_my_home;
var south;
return {
init: function( options ) {
/*
*
* LAYOUT OPTIONS
*
*/
this.options = options;
/*
*
* MAIN LAYOUT & REGION DEF
*
*/
layout = new Ext.BorderLayout(document.body, {
north: {
split: false,
titlebar: false
},
center: {
titlebar: false,
autoScroll: true,
closeOnTab: true,
tabPosition: "top",
alwaysShowTabs: true
},
south: {
split: false,
initialSize: 20,
minSize: 20,
maxSize: 20,
titlebar: false,
collapsible: true,
animate: false
}
});
/*
*
* START LAYOUT DEF
*
*/
layout.beginUpdate();
/*
*
* NORTH REGION
*
*/
north = new Ext.ContentPanel('header', {
title: 'Tool Bar',
closeable: true
});
layout.add( 'north' , north );
/*
*
* CENTER REGION : ISSUES, HOME, MY HOME PANEL
*
*/
center_issues = new Ext.ContentPanel('issues', {
title: 'Known Issues',
closable: false,
url: "issues.asp",
loadOnce: true,
background: true
});
layout.add( 'center' , center_issues );
center_home = new Ext.ContentPanel('home', {
title: 'Home',
closable: false,
url: "home.asp",
loadOnce: true,
background: true
});
layout.add( 'center' , center_home );
center_my_home = new Ext.ContentPanel('my_home', {
title: 'My Home',
closable: false,
url: "my_home.asp",
loadOnce: true,
background: true
});
layout.add( 'center' , center_my_home );
/*
*
* SOUTH REGION
*
*/
south = new Ext.ContentPanel('footer', {
title: 'Status Bar',
closable: true
});
layout.add( 'south' , south );
/*
*
* END LAYOUT DEF
*
*/
layout.endUpdate();
/*
*
* SHOW DEFAULT PANEL
*
*/
layout.showPanel( this.options.panel );
}
};
}();
Ext.EventManager.onDocumentReady( Layout.init.createDelegate( Layout , [{panel: 'home'}] ) , Layout , true );
var Layout = function() {
var layout;
var north;
var center_issues;
var center_home;
var center_my_home;
var south;
return {
init: function( options ) {
/*
*
* LAYOUT OPTIONS
*
*/
this.options = options;
/*
*
* MAIN LAYOUT & REGION DEF
*
*/
layout = new Ext.BorderLayout(document.body, {
north: {
split: false,
titlebar: false
},
center: {
titlebar: false,
autoScroll: true,
closeOnTab: true,
tabPosition: "top",
alwaysShowTabs: true
},
south: {
split: false,
initialSize: 20,
minSize: 20,
maxSize: 20,
titlebar: false,
collapsible: true,
animate: false
}
});
/*
*
* START LAYOUT DEF
*
*/
layout.beginUpdate();
/*
*
* NORTH REGION
*
*/
north = new Ext.ContentPanel('header', {
title: 'Tool Bar',
closeable: true
});
layout.add( 'north' , north );
/*
*
* CENTER REGION : ISSUES, HOME, MY HOME PANEL
*
*/
center_issues = new Ext.ContentPanel('issues', {
title: 'Known Issues',
closable: false,
url: "issues.asp",
loadOnce: true,
background: true
});
layout.add( 'center' , center_issues );
center_home = new Ext.ContentPanel('home', {
title: 'Home',
closable: false,
url: "home.asp",
loadOnce: true,
background: true
});
layout.add( 'center' , center_home );
center_my_home = new Ext.ContentPanel('my_home', {
title: 'My Home',
closable: false,
url: "my_home.asp",
loadOnce: true,
background: true
});
layout.add( 'center' , center_my_home );
/*
*
* SOUTH REGION
*
*/
south = new Ext.ContentPanel('footer', {
title: 'Status Bar',
closable: true
});
layout.add( 'south' , south );
/*
*
* END LAYOUT DEF
*
*/
layout.endUpdate();
/*
*
* SHOW DEFAULT PANEL
*
*/
layout.showPanel( this.options.panel );
}
};
}();
Ext.EventManager.onDocumentReady( Layout.init.createDelegate( Layout , [{panel: 'home'}] ) , Layout , true );