PDA

View Full Version : Create secound instance of object after destroy first one does not work



LizMyself
24 Jul 2014, 11:31 PM
Hey together,

I create an instance of an object.

After using destroy or close I can't create an secound Object of it.
I can do so if I only hide the first one.

I tried

var oReport = Ext.create('Xx.report.view.report.Main', {
menuParams: params
});

and also

var oReport = {
xtype:'report',
menuParams: menuParams
};

If I sad I can do as may Instances as I want untill I destroy one of it.

May somebody has a clue what the Problem can be?
I'm sorry I can't give you more code than that because i use to many different files with to much dynamic code.

skirtle
25 Jul 2014, 10:41 AM
This problem is almost always caused by storing instances on the prototype. If you use configs in your class definitions instead everything should work fine.

http://skirtlesden.com/articles/config-objects-on-the-prototype

If it's not that, my second guess would be duplicate ids.

LizMyself
29 Jul 2014, 10:06 PM
Hey,

thanks your link didn't solved my Problem but it did solve another one.

I solved it like this: I did not destroy the object itsolve but its parent.
This works but don't ask me why.

Thanks for your help!
Liz