-
29 Sep 2009 6:26 AM #1
rebuild the window
rebuild the window
Hello !
I have extended the window object.
When the first time the script load the window do work.
When i call the 'command loginverwaltung.show();' in the console from the firebugCode:Ext.onReady(function() { Ext.BLANK_IMAGE_URL = '/lib/extjs3/resources/images/default/s.gif'; Ext.QuickTips.init(); var loginverwaltung = new Ext.Window({ title: 'Test', width: 400, height: 400 }); loginverwaltung.show(); });
i became the message:
'ReferenceError: loginverwaltung is not defined'
How can i recall the window ?
Your sincerly
Stephan
-
29 Sep 2009 6:33 AM #2
This is a scope issue, you should read up on scoping of names in javascript, understanding that will spare you a lot of headache. In this case, the variable 'loginverwaltung' is local to the scope of the function passed to Ext.onReady and can not be accessed from outside. To circumvent that limitation without cluttering the global namespace, give your window an explicit id and call
Code:Ext.getCmp('id-of-your-window').show();
-
29 Sep 2009 7:09 AM #3
recall window
recall window
Hello !
I have change the script
When i type in the firebug consoleCode:Ext.onReady(function() { Ext.BLANK_IMAGE_URL = '/lib/extjs3/resources/images/default/s.gif'; Ext.QuickTips.init(); loginverwaltung = new Ext.Window({ title: 'Test', width: 400, height: 400, id: 'fenster' }); loginverwaltung.show(); });
i became the message: 'wert is undefined'Code:var wert = Ext.getCmp('fenster'); wert.show();
Your sincerly
Stephan
-
29 Sep 2009 7:34 AM #4
Test 2
Test 2
Hello !
I have build a new Test 2
It works fine.Code:var kFenster = function(){ return { bauFenster: new Ext.Window({ title: 'Fenster', id: 'fenster', width: 400, height: 400 }) } // Ende return } // Ende Klasse var oFenster = new kFenster(); oFenster.baueFenster.show();
I close the window !
Now when i type in the firebug console
It works !Code:var oFenster = new kFenster(); oFenster.baueFenster.show();
I think the problem from Test 1 is.
With window.close(); the window object is destroy.
Your sincerly
Stephan
-
29 Sep 2009 7:50 AM #5
Or you configure your window with
to reuse the existing instance and make Ext.getCmp work.Code:closeAction: 'hide'
Viele Grüße
-Chris


Reply With Quote