-
10 May 2012 8:40 AM #1
Complex layout calculation
Complex layout calculation
Hello,
I use to have complex layouts and I unfortunately found a case where the layouts stop being calculated. Of course, I over-simplified the example.
Code:Ext.require(['*']); Ext.onReady(function() { viewport = Ext.create('Ext.Viewport', { layout: { type: 'hbox', align: 'middle' }, items: [{ //width: 150, layout : { type: 'vbox', align: 'stretch' }, items: [{ layout: 'fit', items: [{ xtype: 'displayfield', fieldLabel: 'blah', value: ':-)' }] }] }] }); });
It is enough to specify the width of the vbox (uncomment the "width:" line) or to un-wrap the layout-fit (commenting the lines in red) for the field to draw. In this state, the viewport remains desperately empty (drawn with a height of 0)
-
10 May 2012 5:11 PM #2
In which browsers are you seeing this? Does it log an error "Layout run failed"?
Evan Trimboli
Sencha Developer
Twitter - @evantrimboli
Don't be afraid of the source code!
-
10 May 2012 10:51 PM #3
Chrome, ffox and IE - and no log message. (I didn't check logs in IE)
Here is my HTML ... two simple c/p and you can give a try.
In ext/examples/my/my.(js|html)HTML Code:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>My Example</title> <link rel="stylesheet" type="text/css" href="../../resources/css/ext-all.css" /> <!-- GC --> <script type="text/javascript" src="../../ext-all.js"></script> <script type="text/javascript" src="my.js"></script></head><body></body></html>
version 4.1.0RC3
Build date: 2012-04-09 21:11:41 (689b0758837b782dcb0747ba1c4d8ba76344070d)
-
10 May 2012 11:19 PM #4
I don't see any issue when I run it (see attached).
Evan Trimboli
Sencha Developer
Twitter - @evantrimboli
Don't be afraid of the source code!
-
10 May 2012 11:28 PM #5
Weird weird weird weird.
Are we using the same version?
-
10 May 2012 11:39 PM #6
Ah, no. I was trying on 4.1.0 final.
Evan Trimboli
Sencha Developer
Twitter - @evantrimboli
Don't be afraid of the source code!
-
10 May 2012 11:41 PM #7
Damn, I missed the release.... I run download it.
Thanks again.


Reply With Quote