Opened 11 years ago
Closed 11 years ago
#10241 closed defect (fixed)
[patch] [cla] [regression] GridContainer resize problem with StackContainer child
Reported by: | Mathevet julien | Owned by: | dante |
---|---|---|---|
Priority: | high | Milestone: | 1.4 |
Component: | Dojox | Version: | 1.4.0b |
Keywords: | Cc: | [email protected]… | |
Blocked By: | Blocking: |
Description
I have a GridContainer? with 2 column. And each column take screen size... The resize method of LayoutContainer? doesn't detect gridContainer has parent.
Attachments (2)
Change History (16)
Changed 11 years ago by
Attachment: | test_gridContainer_TabContainer.html added |
---|
comment:1 Changed 11 years ago by
comment:2 Changed 11 years ago by
Owner: | changed from Adam Peller to dante |
---|
comment:3 Changed 11 years ago by
Seem adding isLayoutContainer: true, to GridContainer? fix problem.
In fact Child widgets are loaded before, grid initialize column.
comment:5 Changed 11 years ago by
This patch doesn't fix this example, but it fixs many of mines. I use a widget that extends StackContainer. And works for all of yours. I have juste reorganized build order. And this is repect more "widget layout".
comment:6 Changed 11 years ago by
Main problem in your svn version is the GridContainer? doesn't respect the new design of inheritance of StackContainer?. I fix it and fix startup childs. I have also reduced size code, removing unused or duplicated variable. I hope you will add this patch for 1.4 version. Currently your version doesn't work for me.
comment:7 Changed 11 years ago by
Summary: | GridContainer resize problem with StackContainer child → [patch] [regression] GridContainer resize problem with StackContainer child |
---|
Do you have a CLA? I looked up your user info but it just says that your name is Moogle Moogle.
comment:8 Changed 11 years ago by
I have send it today .... But I couldn't modify my user first on trac or on dojotoolkit website... My name is Julien Mathevet
Changed 11 years ago by
Attachment: | patchGridContainer.patch added |
---|
comment:9 Changed 11 years ago by
Milestone: | tbd → 1.4 |
---|---|
Summary: | [patch] [regression] GridContainer resize problem with StackContainer child → [patch] [cla] [regression] GridContainer resize problem with StackContainer child |
comment:10 Changed 11 years ago by
Status: | new → assigned |
---|
comment:11 Changed 11 years ago by
Hmmm, so I'm not seeing anything useful in the tabContainer test case attached. The patch applies fine, and looks ok but to be honest I'm not clear on what this is fixing.
comment:12 Changed 11 years ago by
Yes I know it's not a good example but there few widget that extends LayouWidget?. The main problem is startup order. In current GridContainer it tries to start many time childs without any reasons... And then my child start before the grid. Then there column aren't set up an child take wrong size. And there is also conceptual problem.
And it fixes also getChildren method: #10244. So the resize method doesn't work.
Ok I will try to add a more clear example.
Current code:
startup:function(){ // Start childs and get wrong size this.inherited(arguments); // create columns this._createCells(); // start again childs dojo.forEach(this.getChildren(), function(child){ if(!child.started && !child._started){ child.startup(); } }); // move child in table grid if(this.usepref !== true){ this[(this.isAutoOrganized ? "_organizeServices" : "_organizeServicesManually")](); }else{ //console.info("GridContainer organised by UserPref"); return; } // create grids this.init(); },
comment:13 Changed 11 years ago by
If you look at _Container, startup says:
// summary: // Called after all the widgets have been instantiated and their // dom nodes have been inserted somewhere under dojo.doc.body. // // Widgets should override this method to do any initialization // dependent on other widgets existing, and then call // this superclass method to finish things off. // // startup() in subclasses shouldn't do anything // size related because the size of the widget hasn't been set yet.
So this.inherited(arguments); need to be call at end of child startup. why dev has done that. Because getChildren method return only node are directly under ContainerNode. So after move childs inside table grid, getChildren method return an empty array. So childs aren't started. But in current code child are started before GridContainer finish to be built. In svn tests they are only ContentPane child. But !_LayoutWidget child doesn't manage resize method like ContentPane and they take size of ContainerNode and not of grid cell.
There is also confusing method between addService and addChild. If you do addChild after startup it will not be insertted inside grid. And if you do addService before startup child will be never startup.
So this patch fix getChildren, startup, addChild in repecting parents conception.
comment:14 Changed 11 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
And in this example tabContainer isn't shown also.