OlleJonsson
9 Jul 2010, 1:03 AM
(Question of procedure: If this is marked "DUPE", where's the real bug to watch?)
Ext.Panel.syncHeight uses a value which can be a string as a number. Consider the local variable lsh:
Code copied from Ext JS Library 3.2.1.
syncHeight : function(){
var h = this.toolbarHeight,
bd = this.body,
lsh = this.lastSize.height,
sz;
if(this.autoHeight || !Ext.isDefined(lsh) || lsh == 'auto'){
return;
}
if(h != this.getToolbarHeight()){
h = Math.max(0, lsh - this.getFrameHeight());
bd.setHeight(h);
sz = bd.getSize();
this.toolbarHeight = this.getToolbarHeight();
this.onBodyResize(sz.width, sz.height);
}
},
Here, a "fix" which points out the problem, in the same way as the above poster handled his situation.
syncHeight : function(){
var h = this.toolbarHeight,
bd = this.body,
lsh = this.lastSize.height,
sz;
if (isNaN(lsh)) {
lsh = 'auto'; // avoiding "Invalid argument" error down the line, since lsh can be '100%'
}
if(this.autoHeight || !Ext.isDefined(lsh) || lsh == 'auto'){
return;
}
if(h != this.getToolbarHeight()){
h = Math.max(0, lsh - this.getFrameHeight()); // otherwise, we'd be in trouble here
bd.setHeight(h);
sz = bd.getSize();
this.toolbarHeight = this.getToolbarHeight();
this.onBodyResize(sz.width, sz.height);
}
},
Ext.Panel.syncHeight uses a value which can be a string as a number. Consider the local variable lsh:
Code copied from Ext JS Library 3.2.1.
syncHeight : function(){
var h = this.toolbarHeight,
bd = this.body,
lsh = this.lastSize.height,
sz;
if(this.autoHeight || !Ext.isDefined(lsh) || lsh == 'auto'){
return;
}
if(h != this.getToolbarHeight()){
h = Math.max(0, lsh - this.getFrameHeight());
bd.setHeight(h);
sz = bd.getSize();
this.toolbarHeight = this.getToolbarHeight();
this.onBodyResize(sz.width, sz.height);
}
},
Here, a "fix" which points out the problem, in the same way as the above poster handled his situation.
syncHeight : function(){
var h = this.toolbarHeight,
bd = this.body,
lsh = this.lastSize.height,
sz;
if (isNaN(lsh)) {
lsh = 'auto'; // avoiding "Invalid argument" error down the line, since lsh can be '100%'
}
if(this.autoHeight || !Ext.isDefined(lsh) || lsh == 'auto'){
return;
}
if(h != this.getToolbarHeight()){
h = Math.max(0, lsh - this.getFrameHeight()); // otherwise, we'd be in trouble here
bd.setHeight(h);
sz = bd.getSize();
this.toolbarHeight = this.getToolbarHeight();
this.onBodyResize(sz.width, sz.height);
}
},