Window with accordion doesn't close.

I have this code:


function downloader(personid,modulename)
	{       

                        var selectordhxWins = new dhtmlXWindows();
			var dlwin = selectordhxWins.createWindow("ws_downloader", 100, 100, 600, 400);
			dlwin.setText("Download file");
			dlwin.centerOnScreen();

                        dlwin.bringToTop();
                        dlwin.setModal(true);
                        var dlayout = new dhtmlXLayoutObject(dlwin,"1C");

                        dlayout.cells("a").setText("Documents");
                        
                        var dhxAccord = dlayout.cells("a").attachAccordion();
                        var dload = dhxAccord.addItem("downloader", "Download");
                        
                        var wgrid = dload.attachGrid();
                        var wsb = dload.attachStatusBar();
                        wgrid.setHeader("Filename,Size");
                        wgrid.setInitWidths("200,*");
                        wgrid.setColAlign("left,left");
                        wgrid.setColTypes("ro,ro");
                        wgrid.setColSorting("str,str");
                        wgrid.init();

                        wgrid.attachHeader("#text_filter,#text_filter");

                        wgrid.load('xml/downloader_grid.php',function(){
                            wsb.setText("Total rows:"+wgrid.getRowsNum());
                        });

                        wgrid.attachEvent("onRowDblClicked", function(rID,cInd){
                            var dlid = rID;
                            var dldescr = wgrid.cells(wgrid.getSelectedId(),0).getValue();
                            
                           
                            var iframe = parent.parent.document.getElementById('downloader');

                            iframe.src = 'xml/downloader_getfile.php?fileName='+dldescr;
                            dlwin.setModal(false);
                            dlwin.close();

                        })

			return dlwin;
	}

When it is executed it creates the object properly but when I click on “X” to close the window it doesn’t close.

If Accordion is not used and I use layout then it works fine.

Here is the code used with layout:


function downloader(personid,modulename)
	{       

                        var selectordhxWins = new dhtmlXWindows();
			var dlwin = selectordhxWins.createWindow("ws_downloader", 100, 100, 600, 400);
			dlwin.setText("Download file");
			dlwin.centerOnScreen();

                        dlwin.bringToTop();
                        dlwin.setModal(true);
                        var dlayout = new dhtmlXLayoutObject(dlwin,"1C");

                        dlayout.cells("a").setText("Documents");
                        
                        //var dhxAccord = dlayout.cells("a").attachAccordion();
                        //var dload = dhxAccord.addItem("downloader", "Download");
                        //var uload = dhxAccord.addItem("uploader", "Upload");

                        var wgrid = dlayout.cells("a").attachGrid();
                        var wsb = dlayout.cells("a").attachStatusBar();
                        wgrid.setHeader("Filename,Size");
                        wgrid.setInitWidths("200,*");
                        wgrid.setColAlign("left,left");
                        wgrid.setColTypes("ro,ro");
                        wgrid.setColSorting("str,str");
                        wgrid.init();

                        wgrid.attachHeader("#text_filter,#text_filter");

                        wgrid.load('xml/downloader_grid.php',function(){
                            wsb.setText("Total rows:"+wgrid.getRowsNum());
                        });

                        wgrid.attachEvent("onRowDblClicked", function(rID,cInd){
                            var dlid = rID;
                            var dldescr = wgrid.cells(wgrid.getSelectedId(),0).getValue();
                            
                            
                            var iframe = parent.parent.document.getElementById('downloader');

                            iframe.src = 'xml/downloader_getfile.php?fileName='+dldescr;
                            dlwin.setModal(false);
                            dlwin.close();

                        })

			return dlwin;
	}

You can find attached a screencast of the behavior with accordion.
notclosing_video.zip (95.6 KB)

Also tried to use TabBar ,the window closes properly when using TabBar but I get a Warning:

[warning] dhtmlXTabBar destructor needed

Could you attach the sample that allows recreate the problem (with all necessary files)

Sure.

Open start.php

(I also included dhtmlx.js & css )
notclosing.zip (236 KB)

Hello,

we have tested the demo. It closes when the button in the right top corner clicked. And parent.winvar.close(); (not parent.w_ma_LOANS.close():wink: closes the window from the inner.php

I think you pressed the wrong button.

Press “Downloader” button to open the window with Accordion 1st.

Hello,

did you confirm the problem after pressing the download button?

When the new window appears then it doesn’t close.

Hello,

we have found a bug in the dhtmlxaccordion.js

The fixed file is attached

Moreover, if the same window opens/closes several times, it would be better to use hide show the window.

win.attachEvent(“onClose”,function(){
win.hide();
});

Show the window that is already created, you may use show() method:

win.show();
dhtmlxaccordion.zip (6.11 KB)