PDA

View Full Version : "Layout run failed" error message.



mkaw
14 Jun 2012, 12:40 AM
What could be reason of : "Layout run failed"? Extjs 4.1.

scottmartin
15 Jun 2012, 7:01 PM
You most likely have a bad layout design or you have defined but not created your UI properly.

Is there a basic example that you are trying to get working?

Scott.

mkaw
18 Jun 2012, 2:14 AM
I have window:

Ext.define('MyApp.view.MyWindow', { extend: 'Ext.window.Window',
height: 418,
width: 731,
layout: {
align: 'stretch',
type: 'vbox'
},
title: 'My Window',
initComponent: function() {
var me = this;
Ext.applyIf(me, {
items: [
{
xtype: 'panel',
title: 'My Panel',
flex : 1,
collapseDirection: 'bottom',
collapsed: false,
collapsible: true,
layout:{
type : 'auto'
},
},
{
xtype: 'form',
layout: {
type: 'fit'
},
bodyPadding: 10,
title: 'My Form',
flex: 3,
items: [
{
xtype: 'form',
id: 'document-form',
autoScroll: true,
flex : 3,
bodyPadding: 20,
title: 'Dokument',
layout:{
type : 'auto'
}
}
]
}
]
});
me.callParent(arguments);
}
});
To this window I add programmatically some components using Ext.widget({obj});



var form = Ext.getCmp('document-form');
form.add(Ext.widget({
"id":"305_0_zezw","xtype":"panel","height":200,"hidden":false,"margin":"0 0 10","autoScroll":true,"bodyPadding":"10","collapseDirection":"bottom","collapsed":false,"collapsible":true,"dockedItems":[],"items":[],"layout":{"type":"anchor"},"title":"z"
}));
form.add(Ext.widget({
"id":"305_0_grasz","xtype":"checkboxfield","hidden":false,"margin":"0 0 10","flex":1,"fieldLabel":"Grasz?","checked":false
}));

And next to panel with id: "305_0_zezw" i add:


var panel = Ext.getCmp('305_0_zezw');
panel.add(Ext.widget({
"id":"305_0_f1","xtype":"datefield","hidden":false,"margin":"0 0 10","flex":1,"value":"","fieldLabel":"f1"
}));
panel.add(Ext.widget({
"id":"305_0_f2","xtype":"textfield","hidden":false,"margin":"0 0 10","flex":1,"value":"","fieldLabel":"f2","allowBlank":false
}));
panel.add(Ext.widget({
"id":"305_0_f3","xtype":"checkboxfield","hidden":false,"margin":"0 0 10","flex":1,"fieldLabel":"f3.","checked":false
}));


View is displayed correctly but when i click on collapse button i have "Layout run failed" and nothing happen.

evant
18 Jun 2012, 2:16 AM
Try grabbing 4.1.1RC2: http://www.sencha.com/forum/showthread.php?219836-Ext-JS-4.1.1-RC2-Now-Available

mkaw
19 Jun 2012, 7:03 AM
I figured it out. I created Extjs using Ext.widget like this:


Ext.widget({
xtype: 'panel',
dockedItems : null,
items : null,

...

});

And this is wrong. Items, dockedItems and other component list should be empty [] but not null. ;)


Ext.widget({
xtype: 'panel',
dockedItems : [],
items : [],

...

});