PDA

View Full Version : Window closing and not removing config



fily55
26 Oct 2012, 7:15 AM
Hi guys,

I have a xtype that extends an extjs window. This xtype has the following in the config:



Ext.define("path",{
extend: "Ext.window.Window",
alias: "widget.myWindow",

config : {
width : 1020,

height : 600,

modal : true,

resizable : false
},

cards : []



When I first create the window the cards are created, and it is populated in the config with some panels.
e.g.( cards becomes [panel1,panel2,panel3]).

When I close the window the cards should destroy and become [] right?

Well when I reopen the window the cards are created again and put into the config. But the cards array from before didn't become empty, and now I have multiple cards.
e.g.( cards becomes [panel1, panel2, panel3, panel1, panel2, panel3).

This has been at me for weeks now, would love to get any help.

Thanks in advance

Tim Toady
26 Oct 2012, 7:36 AM
I usually avoid putting complex types on the prototype. I usually add them from something like initComponent or a method called from initComponent. Then you never have to worry about other instances...

fily55
28 Oct 2012, 1:35 AM
Yes, that did work. Thanks very much for your help.