Warning that `Id` exists and must be destroyed

In most cases, I see the following warning when I press the same button more than once (when calling the same function twice or more)

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

How should I destroyuse this warning? or how to fix it?

UPDATE

function onPersonFound(imageData) {
           var image = Ext.create('Ext.Img', {
                                 src: "data:image/jpeg;base64," + imageData,
                                 id: 'logo',
                                 width: 372,
                                 height: 140
                                 });
+3
source share
2 answers

[WARN] [Ext.Component # constructor] Register a component with identifier ( name) that has already been used. Verify that the existing component has been destroyed ( Ext.Component#destroy().

, id:name. id itemId.

itemId id?

itemId . id Ext.getCmp, itemId Ext.Container.getComponent, itemId id. itemId MixedCollection, itemId - Ext.ComponentManager .

+5

, , Sencha Touch Ext.Image logo. id logo, 2 id. , id.

"config" id - , id . :

function onPersonFound(imageData) {
           var image = Ext.create('Ext.Img', {
                                 src: "data:image/jpeg;base64," + imageData,
                                 id: 'logo' + person_id,
                                 width: 372,
                                 height: 140
                                 });

. person_id , id. , .

0

All Articles