mardi 18 mars 2014

Custom property persist on destroy

Hi all, I'm having a problem with "customProp" of "myChild". No matter how I destroy "myChild" component (destroying myChild or myWindow), next time I create it, the "customProp" persists it's value.



Definitions:


Code:



Ext.define('MyApp.view.MyWindow', {
extend: 'Ext.window.Window'

,xtype: 'myWindow'

,autoDestroy: true

,items: [{

xtype: 'myChild'

}]

});

Ext.define('MyApp.view.myChild', {

extend: 'Ext.conteiner.Container'

,xtype: 'myChild'

,customProp: []

});


Creation:


Code:



Ext.create('MyApp.view.MyWindow');


Then, in some other parts of my code I change this "customProp" from [] to [3, 7]. Everything is fine for now.

Then I destroy "myWindow" and check if any of my classes are still there: they were destroyed.

Finally, I create "myWindow" again:


Code:



Ext.create('MyApp.view.MyWindow');


And "customProp" of "myChild" still [3,7], and it should be empty as it is defined.

Shouldn't "myChild" be created with the definition I declared and overwrite "customProp"? Any ideas why this is happend? Solution?



Thanks!



Workarround:

If I do this, problem is "solved", but it's not what I'm looking for because it's kind of restrictive.


Code:



Ext.define('MyApp.view.MyWindow', {
extend: 'Ext.window.Window'

,xtype: 'myWindow'

,autoDestroy: true

,items: [{

xtype: 'container'

,customProp: []

}]

});






Aucun commentaire:

Enregistrer un commentaire