singleton windows
I am trying the following but what I don't get is that I explicitly have to nullify the variable on the close of the window. There is also a memory leak problem with all my dialogs which might be related.
Hope someone can help. TIA. Code is:
var uploadContextWindow = null;
mapfish.widgets.UploadContext.show = function(windowTitle, width, height) {
if (uploadContextWindow === null) {
uploadContextWindow = new Ext.Window({
id: 'uploadcontext',
title: windowTitle,
width: width,
height: height,
layout: 'fit',
cls: 'popup-variant1',
plain: true,
collapsible:true,
items: new Ext.TabPanel({
border: false,
baseCls: 'x-tab',
cls: 'x-tab-variant3',
activeTab: mapfish.widgets.Login.getUser() ? 0 : 1,
deferredRender: false,
tabPosition: 'top',
items: [ {
title: 'Profiel',
xtype: 'uploadcontext',
disabled: !mapfish.widgets.Login.getUser(),
map: map
}, {title: 'Deze computer', xtype: 'uploadcontextfile', map: map} ], buttons: [{text: 'Sluiten', handler: function() { Ext.getCmp('uploadcontext').close(); }}] })
});
}
uploadContextWindow.show();
uploadContextWindow.on('close', function() { uploadContextWindow = null });
uploadContextWindow.center();
}
I'm using this approach successfully in one of my app, where I have several objects and one properties window for them. As I open the window for a particular object I "bind" it to that object such a way that properties of that object are edited. This binding is released on close (hide in fact).
#If you have any other info about this subject , Please add it free.# |

