dhtmlxWindow Reload Parent

Hello



I have a dhtmlxWindow that has an input button on it to close the Window. Is there anyway that when the input button it clicked the parent page (where the xwindow was generated from) can be refreshed.



In my case, database changes are made in the xWindow, which I then need to refresh the page to display the changes.



Thanks

David

Hi,

Are you using attachURL and want to reload it?


I have a page, say main.php, that page has a tree control on it.



There in a link on main.php, that opens a dhtmlxWindow, in that window that opens, a user makes changes to the database that populates the tree.



Therefore when they close the dhtmlxWindow window, the information shown in the tree on main.php is no longer valid, and either needs the tree to be reloaded, or the page refreshed.



Thanks



David

You shoud overwrite document.location or use xml-refreshing for tree.


ok, I have tried this on the dhtmlxwindow:







The attached file shows what I mean, the window in the front has the Reload Page button, which when pressed, I want to reload the tree in the back ground (the page the xwindow was opened from)



Thanks
David



dhtmlxWindow is a part of the same page, so direct javascript calls must work correctly.
By the way you code is a bit incorrect
a) it must be onClick=‘tree.refreshItem(0)’>
b) beware, that refreshItem works only for dynamic trees ( for static one you will need to use tree.deleteChildItems(0); tree.loadXML(url)


Still no go:



This is the code building the tree:



      tree=new dhtmlXTreeObject(“div1”,“100%”,“100%”,0);
      tree.enableCheckBoxes(1);
      tree.enableThreeStateCheckboxes(1);
      tree.setImagePath(“dhtmlxTree/codebase/imgs/csh_bluefolders/”);
      tree.loadXML(“xml_outages.php”);



And the Window:



      var dhxWins = new dhtmlXWindows();
      dhxWins.setImagePath(“dhtmlXWindows/codebase/imgs/”);
      var w1 = dhxWins.createWindow(“w1”, 10, 10, 350, 420);
      w1.setText(“Outage Time”);
      w1.button(“close”).attachEvent(“OnClick”,function(){w1.hide(););
      w1.center();
      w1.denyResize();
      w1.hide();




There is a link on the main page (that contains the above) that run the following function when clicked:



      function deletearea() {
        w1.show();
        var temp = “outage.php?page=delete&frmarea=”+tree.getAllChecked();
        w1.attachURL(temp);
      }




Which opens the deletes the selected items from the tree…  that is the page that contains the buttion, which I have now changed to:







However, when clicking on the button in either ie or firefox the page errors…  using firebug, the error is tree is not defined.



Thanks
David

Is your javascript “tree” variable global?

There in a link on main.php, that opens a dhtmlxWindow, in that window that opens
How do you loading content in dhtmlxWindow, by
w1.attachURL(url); //iframe mode
or by
w1.attachURL(url,true); //ajax mode

In second case (ajax mode), the code above must work correctly
In first case (iframe mode) it need to be updated as
onclick=‘parent.tree.deleteChildItems(0);’>
because the page in window and parent page are two different pages.