user1579339
user1579339

Reputation:

destroy things switching between views

in my program I have 2 'screen', in the first there is a list and if I press an item I go to the second screen… and in the second screen there is a button to return in the first…

when I return in the fist I get this warning

WARN][Ext.Component#constructor] Registering a component with a id (`usernamelabel`)
which has already been used. Please ensure the existing 
component has been destroyed (`Ext.Component#destroy()`.

in the controller i tried something like this:

 itemUp: function (dataview, index, target, record, e, Opst ) {
Ext.Viewport.animateActiveItem({xtype: 'mytabpanel'},{ type: 'flip' );
var store = Ext.getStore('Customers');
store.clearFilter();
Ext.destroy(this.searchField);
Ext.destroy(this.clientsList);
 }

but doesn't work.. how to destroy an entire 'screen'?

PS: if I run the program in iOS or android devices I see ever the same "theme"… how to specialise the theme? (on my win phone 7.8 doens't works.. is normal?)

thanks a lot!!!

Upvotes: 0

Views: 1292

Answers (1)

Eli
Eli

Reputation: 14827

It's because you harcoded id: usernamelabel, so when you initiate it the second time, you'll get above warning message. You'll be safe if you use itemId

Upvotes: 1

Related Questions