PDA

View Full Version : [OPEN] Window with vbox layout: First setHeight() collapses width.



ExtGuy
6 Aug 2013, 4:41 AM
REQUIRED INFORMATION


Ext version tested:


Ext 4.2.1.883
Ext 4.1.1.a



Browser versions tested against:


Chrome 28.0.1500.95 m
IE8
FF22.0 (firebug 1.11.4 installed)
Opera 12.11



Description:


When setHeight(XXX) is called on a window then the width collapses if the vbox layout is used.
Happens only the first time.



Steps to reproduce the problem:


Show an Ext.window.Window with vbox layout.
Call [theWindow].setHeight([a number]).



The result that was expected:


Only the height would change.



The result that occurs instead:


Height changes.
Width collapses to zero.



Test Case:

JavaScript:


Ext.onReady(function() {

var myWindow = Ext.create('Ext.window.Window', {
title: 'The Window'
,layout : {
type : 'vbox' // vbox seems to allow this issue
}
,items:
[
{
xtype: 'button'
,text: 'myWindow.setHeight(150)'
,handler: function(){
myWindow.setHeight(150); // here the width collapses (only the first time)
}
}
,{
xtype: 'button'
,text: 'myWindow.setSize(myWindow.getWidth(), 100)'
,handler: function(){
// workaround:
myWindow.setSize(myWindow.getWidth(), 100);
}
}
]
});

var myButton = Ext.widget('button', {
text: 'Show'
,renderTo: 'start-button'
,handler: function() {
myWindow.show();
}
});

});


HTML:


<!DOCTYPE html>
<html>
<head>

<!-- the extjs css -->
<link rel="stylesheet" type="text/css" href="../../ext-4.2.1.883/resources/css/ext-all.css" />

<!-- the extjs library (ext-all-debug-w-comments for expanded code and comments) -->
<script type="text/javascript" src ="../../ext-4.2.1.883/ext-all-debug-w-comments.js"></script>
<!-- our own java script -->
<script type="text/javascript" src ="button2window.js"></script>

</head>
<body>

<h1>button2window</h1>

<p>
Open an extjs window.<br>
Notice how setting only the height first collapses the width.
</p>
<p>
Javascript source here: <a href="button2window.js">button2window.js</a>.
</p>

<!-- target of the render to of the button -->
<div id="start-button"></div>

</body>
</html>



HELPFUL INFORMATION


Screenshot:
45216

Debugging already done:


Happens at context.run(); in me.flushLayouts(); from updateLayout of the AbstractComponent on line 41591 (ext-all-debug-w-comments.js)



Possible fix:


not provided



Additional CSS used:


only default ext-all.css



Operating System:


WinXP Pro

Gary Schlosberg
6 Aug 2013, 7:00 AM
Thanks for the report! I have opened a bug in our bug tracker.