-
14 Sep 2010 10:35 AM #1
[OPEN-325] Layout Issue: 2 Sections in VBox, Make One Fill Available Space
[OPEN-325] Layout Issue: 2 Sections in VBox, Make One Fill Available Space
Sencha Touch version tested:
- 0.94
- iOS 4
- I have a layout w/ the top most Panel using an hbox w/ left and main
items. The left section uses a VBox with 2 items: content and a video. I
want the content section to take the remaining space and I can't seem
to get it to work w/ 0.94. It worked fine on 0.93.
Code:var content = new Ext.Panel({ layout: { type: 'fit', align: 'stretch', flex: 2 }, style: 'border: 5px solid #666666', html: 'Content' }); var video = new Ext.Panel({ layout: 'fit', style: 'border: 5px solid #666666', width: 320, height: 240, html: 'Video' }); var left = new Ext.Panel({ layout: { type: 'vbox', align: 'stretch', pack: 'end' }, width: 320, items: [content, video] }); var center = new Ext.Panel({ layout: 'fit', flex: 2, style: 'border: 5px solid #666666', html: 'Center' }); Ext.setup({ onReady: function() { var homeScreen = new Ext.Panel({ layout: { type: 'hbox', align: 'stretch', pack: 'start' }, fullscreen: true, items: [left, center] }); } });
-
14 Sep 2010 4:42 PM #2
Confirmed here. Flex just doesn't seem to work in 0.94
-
14 Sep 2010 5:00 PM #3
I think I might have found a possible reason. It seems that in setFlexedItems and onLayout on the box layout it looks if *direction* == 'horizontal'. But, for some reason, VBox sets *orientation* to 'vertical' and not *direction*... Strange that there are two different variables for the same thing. Maybe it was a global search and replace miss?
Changing direction to orientation fixes flex behavior in VBoxes.
-
15 Sep 2010 4:32 PM #4
-
17 Sep 2010 12:43 PM #5
-
22 Sep 2010 7:10 AM #6
-
22 Sep 2010 10:31 AM #7
-
23 Sep 2010 2:15 PM #8
Hi don_bm,
I have looked at your code and changed it so it now works in .93 and the latest version of Touch:
There is no need for layout: 'fit' in all your panels, they will automatically stretch to fit an area. On the panel you wanted to flex (var content), I simply added flex:1, which should be what you are looking for.Code:var content = new Ext.Panel({ flex:1, style: 'border: 5px solid #666666', html: 'Content' }); var video = new Ext.Panel({ style: 'border: 5px solid #666666', width: 320, height: 240, html: 'Video' }); var left = new Ext.Panel({ layout: { type: 'vbox', align: 'stretch', pack: 'end' }, width: 320, items: [content, video] }); var center = new Ext.Panel({ flex: 2, style: 'border: 5px solid #666666', html: 'Center' }); Ext.setup({ onReady: function() { var homeScreen = new Ext.Panel({ layout: { type: 'hbox', align: 'stretch' // pack: 'start' }, fullscreen: true, items: [left, center] }); } });
-
24 Sep 2010 9:17 AM #9
Hi rdougan,
I've tried your code but it doesn't work for 0.95. It does work for 0.93 (and I do realize that the original code I posted didn't even work for 0.93, the flex property should be outside the layout object). Can you verify this and reopen this bug?
EDIT: By "latest version of Touch" do you mean an unreleased version? I assumed you meant 0.95
-
24 Sep 2010 9:25 AM #10
Sorry, I only tested on .93 and the latest version (unreleased) of touch. .96 will be out on Tuesday.
Thank you for reporting this bug. We will make it our priority to review this report.
Similar Threads
-
[OPEN-1169] Flex options is ignored for HtmlEditor in vbox layout
By rixo in forum Ext 3.x: BugsReplies: 1Last Post: 24 Sep 2010, 6:36 AM -
Layout Question: 2 Sections in VBox, Make One Fill Available Space
By don_bm in forum Sencha Touch 1.x: DiscussionReplies: 3Last Post: 14 Sep 2010, 10:31 AM -
[OPEN-770] vbox layout with collapsible items
By vladsch in forum Ext 3.x: BugsReplies: 11Last Post: 12 Aug 2010, 12:08 PM -
[OPEN][3.1] VBox Form Example issue - Opera
By mike1993 in forum Ext 3.x: BugsReplies: 0Last Post: 23 Dec 2009, 10:45 AM -
Nested panel doesn't fill open space after collapsing parent panel
By michiel in forum Ext 1.x: Help & DiscussionReplies: 0Last Post: 22 Aug 2007, 6:46 AM


Reply With Quote