Categories | Question details Back To List | ||
shtmlXWindow This component is Super! I have a question, how can i close modal window from attached html or php document? or attached document conatin button <input type="button" onclick='close.modalwindow('w1')> Answer posted by Support on Aug 12, 2008 09:45 If you are using attachURL , you can access parent window and call related method as <input type="button" onclick="parent.dhxWins.window('w1').close();"> where Answer posted by Piramidon on Feb 28, 2009 21:47 Hi, What if I am using attachObject in situation like that, how can I close modal window by clicking a button inside attached DIV? Thank you. Answer posted by Alex (support) on Mar 02, 2009 08:44 Hi, in this case the approach is simpler - just call close() method for window object. For example: <input type="button" value="close window" onclick="w1.close();"> Answer posted by Piramidon on Mar 02, 2009 11:21 Check my code please: <html> <link rel="stylesheet" type="text/css" href="../../codebase/dhtmlxwindows.css"> </head> <body onLoad="javascript:showModalWindow();"> <div id="myMessageBox" style="font-family: Tahoma; font-size: 10pt; overflow: auto; visibility: hidden;" align="center"><br><br><br><input type="button" value="Close" onClick="w1.close();"></div>
function showModalWindow() { var dhxWins = new dhtmlXWindows(); var w1 = dhxWins.createWindow("w1", 10, 10, 320, 240); dhxWins.window('w1').center(); dhxWins.window('w1').attachObject(myMessageBox); }; </script> I've got 'w1' is undefined javascript error. What is wrong? Thank you. Answer posted by Alex (support) on Mar 03, 2009 02:46 Hello, There is a JavaScript issue in your code - w1 is a private variable. The following will work correctly: var w1; var dhxWins = new dhtmlXWindows(); } |