-
7 Oct 2010 11:43 AM #1
BoxLayout problem with child resizing
BoxLayout problem with child resizing
I work with V|HBoxLayouts. In my app I can resize child items (with help of Ext.Resizable) inside BoxContainers after render. But resizing just doesn't work. After releasing of mouse button child returns to initial width or height (depends on HBox or VBox).
After a couple of hours I figured out that in method Ext.layout.HBoxLayout.calculateChildBoxes(...)
we have:
So, we need component's properties height and width. But method .setSize(w,h) which I use to set new size doesn't set .height and .width if component was already rendered. And I need to set them manually after setSize().Code:.... //gather the total flex of all flexed items and the width taken up by fixed width items for (i = 0; i < visibleCount; i++) { child = visibleItems[i]; childHeight = child.height; childWidth = child.width; ....
I think it's strange... or do I something wrong?
-
11 Oct 2010 3:12 PM #2Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- Frederick MD, NYC, DC
- Posts
- 16,167
- Vote Rating
- 28
are you using setSize on the element or the instance of the Container?

Jay Garcia @ModusJesus || Modus Create co-founder
Ext JS in Action author
Sencha Touch in Action author
Get in touch for Ext JS & Sencha Touch Touch Training
We are also working on Video-based Sencha Touch training: Check it out here.
-
12 Oct 2010 1:32 AM #3
-
12 Oct 2010 1:37 AM #4
Does the item you resize contain a flex config?
Theoretically, you just need to resize the item, and call doLayout on the owning H/Vbox Container.Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
12 Oct 2010 2:08 AM #5
No
Theoretically, you just need to resize the item, and call doLayout on the owning H/Vbox Container.
I do exactly the same.
I use Ext.Window.handleResize method, except code marked with redCode:handleResize : function(box){ var rz = this.resizeBox; if(rz.x != box.x || rz.y != box.y){ this.updateBox(box); }else{ this.setSize(box); if (Ext.isIE6 && Ext.isStrict) { this.doLayout(); } } this.width = box.width; this.height = box.height; this.ownerCt.doLayout(); this.updateHandles(); },
-
12 Oct 2010 2:12 AM #6
You are not setting the size!
You are just setting some properties!Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
12 Oct 2010 3:29 AM #7
I'm not, but this.ownerCt.doLayout() set sizes of child items by calling Ext.layout.(H|V)BoxLayout.calculateChildBoxes(...)
Similar Threads
-
resizing boxlayout items
By MichaelOstrovsky in forum Ext 3.x: Help & DiscussionReplies: 1Last Post: 13 Sep 2010, 12:12 PM -
Window resizing by its child components
By g2mac in forum Ext 3.x: Help & DiscussionReplies: 2Last Post: 12 Aug 2009, 7:38 AM -
[2.2] Panel's Child Panels Not Resizing Properly - IE 7
By carl23934 in forum Ext 2.x: Help & DiscussionReplies: 18Last Post: 3 Nov 2008, 12:48 AM -
[2.1][CLOSED] Maximizing a window disables resizing of child elements
By lyml in forum Ext 2.x: BugsReplies: 1Last Post: 14 Jul 2008, 8:47 AM


Reply With Quote