Click Tree and Open Popup Window

Dear Support Team,



Could you help to give a simple sample if i want to click item from the tree in cell a with 2U layout and when click the tree item it will popup window (320px x 240px) attach url from google.com



thx a lot



regards,

Robby


Dear Robby,


probably you use attachTree method to place tree into the layout cell:


dhxTree = dhxLayout.cells(“a”).attachTree();


So, tree object is known. In order to execute some code when tree item is clicked you can use onClick event handler:


dhxWins = new dhtmlXWindows();





tree.attachEvent(“onClick”,function(itemId,previousSelected){


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


w1.attachURL(“http://www.google.com/”);


})


Dear Alex,



 



I have succeed to open new window when click the item from tree based on your sample and i make some change that tree is used xml code. Now, i want to close that window but never see the close item in the windows, here is my code (i give a bold for related open window code) :



 



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "google.com/");

 
 }









Hello,


>> Now, i want to close that window but never see the close item in the windows


Please, check that you use all images for dhx_skyblue skin. They are dhtmlxWindows/codebase/imgs/dhxwins_dhx_skyblue


Dear Alex,



Thanks a lot for your help, now the window normaly. But there are another problem, when i click the close bar, it cannot clos, minimize and maximize is ok (working) only close cannot.



Here is my part code (i use xml code to iFrame google.com in that window):



 w1 = dhxWins.createWindow(“w1”, 20, 30, 320, 240);
 w1.setText(“Panduan Solusi”);
 w1.center();
 w1.allowMove();
 w1.close();
 w1.attachURL(dhxToolAccordss.getUserData(id,“url”));




which part i’m wrong ?



 



BR,



Robby


there was a bug with closing window if the url is attached into it.


Please, try to use attached files instead of the originals. Probably they will solve the issue


dhtmlxcommon.zip (6.54 KB)
dhtmlxcontainer.zip (5.89 KB)


Dear Alex,



It still same result, i cannot close the windows. Any sugestion ?



regard,



Robby


Hello,


could you please provide the complete demo, sample that allows to recreate the problem. It can be also sent to support@dhtmlx.com


Dear Support team,



thanks for your support, i appreciate it. I already send the source code by yahoo mail with subject : Click Tree and Open Popup Window Source Code



thank you,



regard,



Robby


Hello,


we have got the sample. The answer will be sent by eamil.


Dear Support Team,



Thanks a lot, it works now, thank you for your best support :slight_smile:



regards,



Robby