27 Dec 2011 10:45 AM #1
4.1 beta layout problem - widthModel.calculated
One of our layouts is failing. In the layout diagnostics layer, we see the failure within the checkAuthority function because me.target.ownerLayout is true, and widthModel.calculated is false (model.calculated).
The error is: [E] contextScreen<container> cannot set width.
Is anyone else seeing issues like this? Thanks.
27 Dec 2011 11:05 AM #2
- Join Date
- Mar 2007
- Gainesville, FL
- Vote Rating
When you say one of your layouts is it a custom layout? if so, this is one of the things that is said to be affected by the layout changes that had to be made.Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Software Engineer
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services email@example.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!
When posting code, please use BBCode's CODE tags.
27 Dec 2011 11:10 AM #3
The checkAuthority function is a bit too aggressive here I think and throws an exception. We wanted it that strict for our development, but it is actually not helpful here.
Could you convert the Ext.Error.raise statement in checkAuthority into:
Ext.log.error(setBy + ' should not set ' + prop);
That should let you get to the rest of the diagnostic that explains what is happening when you don't load the diagnostic layer.
Once that runs you should have a lot of stuff in the console which you could analyze and/or post here. I think the format may be hard to deduce unless you've used it a lot.
Sorry for the hassle.
27 Dec 2011 1:13 PM #4
Yes, it is a custom layout. I made that change in ContextItem.js, thanks.
I was actually able to get a little further by not adding my configuration object to the items collection before callParent in initComponent. Now, after initComponent, I'm calling the add function on the container.
However, layout woes are not over. I am seeing multiple errors that look like this now:
[E] Layout left connected: container-1006<anchor>
as well as:
[E] Registering duplicate id (id here) with this manager
Any thoughts? This is a pretty dynamic system, with many different types of controls dynamically added to the main layout.
27 Dec 2011 1:36 PM #5
- Join Date
- Apr 2007
- Sydney, Australia
- Vote Rating
The latter error indicates components with duplicate id's are being created. I'd suggest eliminating this first since it's likely going to cause other issues during development.Evan Trimboli
Twitter - @evantrimboli
Don't be afraid of the source code!
27 Dec 2011 1:41 PM #6
I will look into this.
Our code was not changed; it was just running in 4.0.7 without issue. Why would this be breaking in the new version? Thanks.
27 Dec 2011 2:13 PM #7
How complex is your custom layout? Converting a layout can be simple or difficult depending on what it is doing. I am happy to help if you have questions on this part.
27 Dec 2011 2:15 PM #8
It looks like I've been able to resolve most of those types of id related issues with a similar fix to which I've already alluded to: not setting this.items in initComponent, but instead calling add on the container after calling the parent. I am still getting the occasional "should not set width" though.
I am also getting framework warnings, though, such as:
[W] BAD! gridcolumn-1108.height set by gridcolumn-1108<columncomponent> and headercontainer-1107<gridcolumn>
ext-all-dev.js:6570[W] BAD! gridcolumn-1128.height set by gridcolumn-1128<columncomponent> and headercontainer-1107<gridcolumn>
ext-all-dev.js:6570[W] BAD! gridcolumn-1109.height set by gridcolumn-1109<columncomponent> and headercontainer-1107<gridcolumn>
ext-all-dev.js:6570[W] BAD! headercontainer-1107.containerChildrenDone set by gridcolumn-1117<columncomponent> and gridcolumn-1109<columncomponent>
ext-all-dev.js:6570[W] BAD! headercontainer-1107.childrenDone set by gridcolumn-1117<columncomponent> and gridcolumn-1109<columncomponent>
Is this normal?
Last edited by ExtJSNinjas; 27 Dec 2011 at 2:16 PM. Reason: removed links
27 Dec 2011 2:25 PM #9
This could happen if the layout run fails, or if there is a JS error during the layout or possibly the duplicate id. Also possibly a bug. I don't think it would effect your initial layout, but might impact subsequent runs.
Does you layout derive from anchor? Maybe a missing callParent or something.
27 Dec 2011 2:31 PM #10
Do you have the layout tree as well? It is quite large for most apps, but it is usually where the root cause is found. Most of the time some value is needed by layout A that should have been calculated by layout B, but for some reason that calculation is either not working or not happening.