-
14 Sep 2011 9:25 AM #1
hbox layout alignment stretchmax not working correctly.
hbox layout alignment stretchmax not working correctly.
I'm having difficultly trying to resolve this problem with stretchmax alignment. Here's some code to reproduce. No height can be specified.
Code:Ext.onReady(function(){ Ext.create('Ext.container.Viewport', { title: 'Parent', items: [ { height: 300, width: 800, items: [ { defaults: { flex: 1 }, layout: { type: 'hbox', align: 'stretchmax' }, items: [ { bodyPadding: 10, items: [ { bodyStyle: 'border-color: white; background-color: white; border-radius: 10px;', bodyPadding: 10, items: [ { html: 'asdfa sdf' } ] } ] }, { bodyPadding: 10, items: [ { bodyStyle: 'border-color: white; background-color: white; border-radius: 10px;', bodyPadding: 10, items: [ { html: 'This panel will have more content than the one to the left. However, eventually the content from this panel is not properly calculated, and the content begins to disappear out of sight :( The expected result should be both panels should stretch to be as large as this one. I do realize that this could be a result of the body padding, equalling twenty pixels, pushing the content down. Perhaps align "stretchmax" doesn\'t factor in bodypadding?' } ] } ] } ] } ] } ], renderTo: Ext.getBody() }); });
-
15 Sep 2011 8:59 AM #2
It looks like a bug (moving this thread to bugs). Also text in my example is chopped:
HTML Code:<!DOCTYPE html> <!-- hbox-stretchmax.html --> <html> <head> <title>Example by Saki</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <link rel="stylesheet" href="ext-4.0.6/resources/css/ext-all.css" type="text/css"> <link rel="shortcut icon" type="image/png" href="../Icon.png"> <script type="text/javascript" src="ext-4.0.6/ext-all-debug.js"></script> <script type="text/javascript"> // entry point Ext.onReady(function() { var p = Ext.create('Ext.panel.Panel', { layout:{ type:'hbox' ,align:'stretchmax' } ,width:500 // ,height:200 ,defaults:{ flex:1 } ,renderTo:Ext.getBody() ,title:'HBox Stretchamx' ,items:[{ html: 'This panel will have more content than the one to the left. However, eventually the content from this panel is not properly calculated, and the content begins to disappear out of sight :( The expected result should be both panels should stretch to be as large as this one. I do realize that this could be a result of the body padding, equalling twenty pixels, pushing the content down. Perhaps align "stretchmax" doesn\'t factor in bodypadding?' },{ html:'two' },{ html:'one' }] }); }); // eo onReady </script> </head> <body> </body> </html> <!-- eof -->
Jozef Sakalos, aka Saki
A lot of valuable info at:
Saki's Extensions and Plugins
Saki's Extensions and Plugins Docs
Saki's Examples, Latest: Grid in Card Layout
Saki's Blog, Featured: Writing a Big Application in Ext, Latest: Grid MultiSearch Plugin Video
-
15 Sep 2011 12:36 PM #3
As a possible fix, could you force a call to doComponentLayout and have the hbox recalculate? Perhaps by adding a listener for afterrender? I've been attempting to do this, but I haven't had much success.
Looks like we cannot reproduce this. Please provide another test case to reproduce this issue.


Reply With Quote