PDA

View Full Version : [FIXED] [2.2] BorderLayout Regions do not follow stateful:false



watrboy00
21 Aug 2008, 1:45 PM
a. Ext 2.2
b. ext-base.js
c. Not OS Specific
d. Not browser specific

e. Simple setup... Viewport with at least one collapsible region using stateful: false as a config for the region.

What steps will reproduce the problem?
Collapse the region. A state change cookie with be created for the region that was just collapsed.

Can you provide a fix for this problem?
Problem arises because onCollapse, onExpand, onSplitMove does not check if the panel is stateful.

Here are two possible fixes.

Component.js

saveState: function() {
if ( this.stateful !== false ) {
if ( Ext.state.Manager ) {
var state = this.getState();

if ( this.fireEvent( 'beforestatesave' , this , state ) !== false ) {
Ext.state.Manager.set( this.stateId || this.id , state );

this.fireEvent( 'statesave' , this , state );
}
}
}
}

or

BorderLayout.js

// private
onCollapse : function(animate){
this.panel.el.setStyle('z-index', 1);
if(this.lastAnim === false || this.panel.animCollapse === false){
this.getCollapsedEl().dom.style.visibility = 'visible';
}else{
this.getCollapsedEl().slideIn(this.panel.slideAnchor, {duration:.2});
}
this.state.collapsed = true;
if(this.panel.stateful !== false){
this.panel.saveState();
}
}


// private
onExpand : function(){
this.isCollapsed = false;
if(this.splitEl){
this.splitEl.show();
}
this.layout.layout();
this.panel.el.setStyle('z-index', 1);
this.state.collapsed = false;
if(this.panel.stateful !== false){
this.panel.saveState();
}
}


// private
onSplitMove : function(split, newSize){
var s = this.panel.getSize();
this.lastSplitSize = newSize;
if(this.position == 'north' || this.position == 'south'){
this.panel.setSize(s.width, newSize);
this.state.height = newSize;
}else{
this.panel.setSize(newSize, s.height);
this.state.width = newSize;
}
this.layout.layout();
if(this.panel.stateful !== false){
this.panel.saveState();
}
return false;
}

aconran
5 Mar 2009, 11:52 AM
Resolved in SVN Rev 3294 in both branches.