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’)>

If you are using attachURL , you can access parent window and call related method as

- dhxWins - name of window controller in parent windows
- w1 - name of window which need to be closed


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.


in this case the approach is simpler - just call close() method for window object. For example:

Check my code please:


<script  src="…/…/codebase/dhtmlxwindows.js">
<script  src="…/…/codebase/dhtmlxcommon.js">

I’ve got ‘w1’ is undefined javascript error. What is wrong?

Thank you.


There is a JavaScript issue in your code - w1 is a private variable. The following will work correctly:

var w1;

function showModalWindow() {

var dhxWins = new dhtmlXWindows();

w1 = dhxWins.createWindow(“w1”, 10, 10, 320, 240);