-
12 Dec 2011 4:47 AM #1
Component ID is forgotten after component destroy and re-create
Component ID is forgotten after component destroy and re-create
*** Forgot to write - its on PR3 ***
Hi:
I have this:
Code:Ext.define('MyApp.view.Viewport', { extend : 'Ext.Container', xtype : 'myapp-viewport', config : { fullscreen : true, layout : 'card' } }); Ext.application({ name: 'MyApp', controllers: ['MainScreen'], models: [], initialize: function() { console.log('init'); this.callParent(); }, launch: function() { Ext.create('MyApp.view.Viewport'); } });Code:Ext.define('MyApp.view.Profile', { extend: 'Ext.Panel', alias: 'widget.Profile', config: { title: 'Me', iconCls: 'user', scrollable: true, items: [ { id: 'test123', html:'just text' }, { xtype: 'button', id: 'firstButton', text: 'Say Hello again' } ] }, initialize: function() { console.log('initialize Profile view'); this.callParent(); } });It seems that after removing and destroying all the panels in the Viewport, the IDs are forgotten and on recreation Sencha assigns default IDs such as "ext-button-1" and "ext-element-123".Code:Ext.define('MyApp.controller.MainScreen', { extend: 'Ext.app.Controller', views: ['Profile'], init: function() { console.log('Init home controller'); }, onLaunch: function() { console.log('Quests: On Launch controller'); var panel = Ext.create('MyApp.view.Profile'); Ext.Viewport.add([panel]); Ext.Viewport.setActiveItem(panel); Ext.Viewport.removeAll(true) panel = Ext.create('MyApp.view.Profile'); Ext.Viewport.add([panel]); Ext.Viewport.setActiveItem(panel); } });
-
12 Dec 2011 9:43 AM #2Sencha - Sencha Touch Dev Team
- Join Date
- Mar 2007
- Location
- Redwood City, California
- Posts
- 3,659
- Vote Rating
- 14
Thank you for the report.
-
12 Jan 2012 6:13 AM #3
Any news on this?
Any news on this?
Is there someone with a solution? Or do we have to wait for a next release?
Cheers
-
12 Jan 2012 8:08 AM #4
Not sure about a fix, but you could always use name or action instead of id and access the items that way.
-
26 Jan 2012 4:07 AM #5
-
26 Jan 2012 9:14 AM #6Sencha - Sencha Touch Dev Team
- Join Date
- Mar 2007
- Location
- Redwood City, California
- Posts
- 3,659
- Vote Rating
- 14
Looks like this was addressed shortly after the PR4 release. I will verify.
Success! Looks like we've fixed this one. According to our records the fix was applied for
TOUCH-1231
in
2.0.


Reply With Quote