-
17 May 2012 5:24 AM #1
[Ext 4.1.0] childItems is undefined
[Ext 4.1.0] childItems is undefined
Hi all,
Just gessing here if someone could help ! We have this intermittent error in a relatively big application.
The layout crashes sometimes in "Ext.layout.container.Fit" at line 151:
It's like my container doesn't have items ... but it happens in a Grid !!Code:// @private calculate : function (ownerContext) { var me = this, childItems = ownerContext.childItems, // childItems is undefined !!!! length = childItems.length,
I'm not supposed to configure a layout or add items in a Grid ....
Any idea on how to troubleshoot this ?
Thanks!
-
17 May 2012 5:28 AM #2
Out out context it's almost impossible to say. Can you reduce it to a simple test case?
Evan Trimboli
Sencha Developer
Twitter - @evantrimboli
Don't be afraid of the source code!
-
17 May 2012 5:30 AM #3
-
17 May 2012 5:35 AM #4
One question would be, are you triggering a layout inside another layout cycle?
Evan Trimboli
Sencha Developer
Twitter - @evantrimboli
Don't be afraid of the source code!
-
17 May 2012 7:20 AM #5
No I'm not triggering a layout cycle. I actually found out that it is related to the state restore mechanism (which we heavily use). I have not found the real cause for now... still investigating!
Also, I found out in the process that the state save / restore behavior changed for the grid columns in 4.1. We now have to use stateId instead of headerId !
-
17 May 2012 7:41 AM #6
So I found the problem. Don't know if it is a bug or a misconfiguration ...
When setting collapsedMode: 'header' on a grid in a BorderLayout, if the grid starts with collapsed: true, the layout crashes with the error above !
-
17 May 2012 9:04 AM #7
Simple TEST case for the collapseMode bug :
removing "collaped: true" on the West Grid, the layout is ok...
Code:Ext.onReady(function() { var p = Ext.create('Ext.Panel', { height: 600, width: 800, title: 'Test', renderTo: Ext.getBody(), layout: 'border', items: [{ title: 'West', region: 'west', width: 300, animCollapse: false, collapsible: true, collapsed: true, collapseMode: 'header', split: true, weight: 10, xtype: 'grid', columns: [{text: 'col 1'}, {text: 'col 2'}] },{ xtype: 'grid', title: 'North', animCollapse: false, collapsible: true, collapseMode: 'header', height: 200, region: 'north', weight: 1, split: true, columns: [{text: 'col 1'}, {text: 'col 2'}] },{ xtype: 'grid', region: 'center', split: true, columns: [{text: 'col 1'}, {text: 'col 2'}], title: 'Center' }] }); });
-
17 May 2012 9:53 AM #8
Removing 'header' collapseMode now introduces a new bug in my layout when starting collapsed ...
See attached screenshot (duplicate headers).
Sommeday have already seen this ?
I'm not able to reproduce with a simple test case ... I don't understand what is wrong !
Screenshot.png
-
19 May 2012 11:57 PM #9
I can confirm on 4.1.0, however it appears to be fixed for 4.1.1RC1, suggest you check it out.
Evan Trimboli
Sencha Developer
Twitter - @evantrimboli
Don't be afraid of the source code!


Reply With Quote
