Open just one window at a time?

Hi there!

is there any way to ensure that just one window can be open at a time?
I attached a toolbar with some buttons to a grid to add and delete new rows.

Also I can use a form in a window to add new users. Now I can open this window several times - is there any way to avoid this?

Maybe by checking if the window ID is open or not?


   			    toolbar.attachEvent("onClick", 
   			    		function(id){
   			    			  			    			
   			    			switch (id) {
  								case "add":
									var newId = (new Date()).valueOf();
        							mygrid.addRow(newId,",Benutzer,eMail,Name,Vorname,Pass,0");
								break;
								case "delete":
								    var selId = mygrid.getSelectedId()
        								mygrid.deleteRow(selId);
								break;
								case "form":
									var dhxWins = new dhtmlXWindows();								
							    	    dhxWins.createWindow(1, 0,0, 300, 500);
						    	        dhxWins.setSkin("dhx_web");
						    	        dhxWins.window(1).setText("Neuen User anlegen");
						    	        dhxWins.window(1).denyResize();
    									dhxWins.window(1).button("park").disable();
    									dhxWins.window(1).button("park").hide();
    									dhxWins.window(1).centerOnScreen();
								break;
						}
   			    		});

Hi
Init this window and then hide.
Then you need it - just show it. When you close it - just hide it.

Thanks a lot!
That works perfect!

Here’s the code for all the others:

My Window (onLoad)

var dhxWins = new dhtmlXWindows(); dhxWins.createWindow(1, 0,0, 300, 500); dhxWins.setSkin("dhx_web"); dhxWins.window(1).setText("Neuen User anlegen"); dhxWins.window(1).denyResize(); dhxWins.window(1).button("park").disable(); dhxWins.window(1).button("park").hide(); dhxWins.window(1).centerOnScreen(); dhxWins.window(1).hide();

And here the SWITCH for the toolbar buttons:

[code]toolbar.attachEvent(“onClick”,
function(id){

		    			switch (id) {
							case "add":
								var newId = (new Date()).valueOf();
    							mygrid.addRow(newId,",Benutzer,eMail,Name,Vorname,Pass,0");
							break;
							case "delete":
							    var selId = mygrid.getSelectedId()
    								mygrid.deleteRow(selId);
							break;
							case "form":
								dhxWins.window(1).show();

								var myForm = dhxWins.window(1).attachForm();
									myForm.loadStruct("index_form.xml");
	
							break;
						}[/code]