Categories | Question details Back To List | ||
Click item on tree and display iframe Dear Support Team, How to open another websitepage (www.google.com) from tree and display it to cells b (with 2U layout format), here is my plan : ---------------------------------------------------------------------------------------------------- a cells | b cells ---------------------------------------------------------------------------------------------------- +Search By | - www.google.com | Google - www.yahoo.com | ---------------------------------------------------- - www.bing.com | | | | ---------------------------------------------------- | search ---------------------------------------------------------------------------------------------------- Thank you for your help, it will be usefull with simple sample BR, Bern Answer posted by Alex (support) on Nov 04, 2009 02:35 Dear Bernard, here is a small sample: dhxLayout = new dhtmlXLayoutObject("parentId", "2U"); dhxTree = dhxLayout.cells("a").attachTree(); dhxTree.setImagePath("codebase/imgs/"); dhxTree.insertNewChild(0,1,"google"); dhxTree.setUserData(1,"url","http://google.com"); dhxTree.attachEvent("onClick",function(id){ dhxLayout.cells("b").attachURL(dhxTree.getUserData(id,"url")); }) If you load tree structure from xml, the userdata can be set by userdata tag: .. <item id="1" text="google"><userdata name="url">http://google.com</userdata></item> .... Answer posted on Nov 04, 2009 03:51 Dear Alex, i have succed when open iframe without xml tree, but when using xml tree, i always failed, here is my code tree.xml : <item text="Web" id="so" im0="tombs.gif" im1="tombs_open.gif" im2="tombs.gif" > and here is part of my index.html var dhxTreeAccord = dhxAccords.cells("aa1").attachTree();
BR, Bernard Answer posted by Alex (support) on Nov 04, 2009 04:44 You have set the userdata incorrectly. Please, see our previous answer - the correct way is: <item text="google" id="g" im0="books_close.gif" im1="books_open.gif" im2="books_close.gif" ><userdata name="url">http://google.com</userdata></item> Answer posted by Bernard on Nov 04, 2009 07:30 Dear Alex, Thanks you for your correction and all your help :) Regard, Bernard |