Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Madhuri on Jun 14, 2009 12:28
open dhtmlx forum
Script to close a dhtmlx window

Hi Alex,

Thanks for your reply.

I have tried the close method. But it throws a js error "dhxWins is undefined"

Here is the script i use to open the window.

        var w1;       
        var dhxWins;

        function attachURL(url, title, width, height)
        {       
            dhxWins = new dhtmlXWindows();
            dhxWins.setImagePath("../../Includes/dhtmlxWindows/codebase/imgs/");
            dhxWins.setSkin("modern_blue");
           
            w1 = dhxWins.createWindow("w1", 300, document.documentElement.scrollTop+100, width, height);
            w1.setText(title);
            w1.attachURL(url);
            w1.button("close").show();       
        }

The main page calls the above js function to open a dhtmlx window. I want to add a link "click to close" in the dhtmlx window.
On clicking the link the window should close.

i have tried using "w1.close();" and "dhxWins.close();".

Both throw the js error. i think that is because the variables are defined in the main page.

Could you please suggest a solution.

Thanks in advance!
Madhuri
Answer posted on Jun 14, 2009 23:50