-
25 Jan 2012 4:25 PM #1
Basic app broken in PR4 "Replacing a layout after one has already been initialized...
Basic app broken in PR4 "Replacing a layout after one has already been initialized...
All my apps crashed with PR4.
I'm getting "Uncaught Error: [ERROR][Ext.Container#setLayout] Replacing a layout after one has already been initialized is not currently supported." everywhere.
Any known workaround?
You should definitely create a sticky for migrations PR-3 -> PR-4 known issues & current workaround.
Otherwise it's a nightmare
at each update.
Even on the most basic things like :
Application :
Viewport :Code:window.app = { ns: 'MyApp' }; Ext.application({ name: app.ns, controllers: [], launch: function() { d&&console.log(app.ns + '.application#launch', [this, arguments]); // Create Viewport Ext.create(app.ns + '.view.Viewport'); } });
LoginView :Code:Ext.define(app.ns + '.view.Viewport', { id: 'viewport', extend: 'Ext.Container', config: { layout: { type: 'card', animation: {type: 'slide'} }, fullscreen: true }, initialize: function() { d&&console.log(Ext.getDisplayName(arguments.callee), [this, arguments]); this.add([ {xtype: 'login'} ]); this.callParent(); } });
Code:Ext.define(app.ns + '.view.Login', { id: 'login', alias: 'widget.login', extend: 'Ext.form.FormPanel', config: { scrollable: false }, initialize: function() { d&&console.log(Ext.getDisplayName(arguments.callee), [this, arguments]); // Configure component this.add([ { xtype: 'spacer' }, { xtype: 'container', items:[ { xtype: 'fieldset', style: 'margin:4%;', items: [ { xtype: 'emailfield', name: 'email', placeHolder: 'email', attributes: {autocorrect: 'off', autocapitalization:'off'}, required: true }, { xtype: 'passwordfield', name: 'password', placeHolder: 'password', required: true } ]}, { xtype: 'button', text: 'login', action: 'login', style: 'margin:4%;margin-bottom:3em;', handler: function() {} } ] } ]); // Events this.on({ show: function() {} }); this.callParent(); } });
-
25 Jan 2012 4:43 PM #2Sencha - Sencha Touch Dev Team
- Join Date
- Jul 2009
- Location
- Palo Alto, California
- Posts
- 469
- Vote Rating
- 9
Simply move all the callParent() statements in all your initialize() up above the rest of the method body.
Sencha Touch Lead Architect
-
25 Jan 2012 4:45 PM #3Sencha - Sencha Touch Dev Team
- Join Date
- Mar 2007
- Location
- Redwood City, California
- Posts
- 3,653
- Vote Rating
- 14
Seeing how many people have run into this issue, we're going to move initConfig out of initialize in the next release.
Looks like we can't reproduce the issue or there's a problem in the test case provided.


Reply With Quote