Categories | Question details Back To List | ||||||||
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 Answer posted by Support on Dec 01, 2008 08:17 Hi, Are you using attachURL and want to reload it? Answer posted by David on Dec 01, 2008 22:59 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 Answer posted by Support on Dec 02, 2008 00:40 You shoud overwrite document.location or use xml-refreshing for tree. Answer posted by David on Dec 02, 2008 02:47 ok, I have tried this on the dhtmlxwindow: <input type='button' value='Reload Page' onClick='tree.refreshitem(0)'> 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 Attachments (1)
Answer posted by Support on Dec 02, 2008 02:59 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) Answer posted by David on Dec 02, 2008 03:54 Still no go: This is the code building the tree: tree=new dhtmlXTreeObject("div1","100%","100%",0); And the Window: var dhxWins = new dhtmlXWindows(); There is a link on the main page (that contains the above) that run the following function when clicked: function deletearea() { Which opens the deletes the selected items from the tree.... that is the page that contains the buttion, which I have now changed to: <input type='button' value='Reload Page' onClick='tree.deleteChildItems(0);'> However, when clicking on the button in either ie or firefox the page errors.... using firebug, the error is tree is not defined. Thanks Answer posted by Nick Armitage on Dec 02, 2008 05:18 Is your javascript "tree" variable global? Answer posted by Support on Dec 02, 2008 09:22 >>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. |