PDA

View Full Version : ext window object on store record



gabrikid
1 Apr 2014, 1:45 AM
Hi. Let's say that i have a store with some records. I iterate all records to "inject" a Ext.Window object on earch record, like this:

records[i].windowObject = Ext.create('Ext.window.Window', {...});

Right now, i make sure that i close all window objects before remove all records on the store:

records[i].windowObject.close();
...
store.removeAll();

If i skip the window close() step, and only remove all records from the store, all the window objects will be kept alive?

gabrikid
7 Apr 2014, 1:36 AM
hi again. nobody knows about this topic? xD

Farish
7 Apr 2014, 5:25 AM
why dont you give it a try and see what happens?

gabrikid
7 Apr 2014, 9:43 AM
i dont know how. as i said, i'm closing all windows before removing all records. but i do not know how can i know if all the windows are still alive if i do not close them before removing the records.

Farish
7 Apr 2014, 11:23 AM
I cannot understand what you want to do. wont commenting out the line which closes the windows and then running your app show you the effect you want to observe?

evandropoa
7 Apr 2014, 12:35 PM
I think if you skip the close window, it stays in memory, you can observe it when you create a window without assign it to anything like:


Ext.onReady(function(){
Ext.create('Ext.window.Window',{
autoshow: true,
title: 'Test',
width: 300,
height: 300
}
});


If you execute this code, the window will show even without be assigned to a variable, this happens becouse there's dom objects holding it on memory.

evandropoa
7 Apr 2014, 12:40 PM
Besides dom objects references I think it still be registered in the Ext.ComponentManager.

gabrikid
8 Apr 2014, 8:28 AM
hi. thanks for your reply, both you.

farish i think not :S

evandropoa i guess you are right about that.