Categories | Question details Back To List | ||
Showing contents of dhtmlxtree with innerHTML Is it possible to view the contents of a treeview with innerHTML when the data has been populated with an XML file? If so, could you give an example? Thanks.. Answer posted by Alex (support) on Oct 29, 2009 11:14 Hello, could you please explain your requirement in details. What innerHTML did you mean ? and what shoudl be done with it ? Answer posted by Letitia Stellern on Oct 29, 2009 11:50 Alex, I am trying to take the contents of one dhtmlxtree and display into a <div> elsewhere on my page. I thought that by using innerHTML to display with onclick() to the div will solve my problem, but that’s not the case – When I click the preview template button, I get an undefined error. My treeviews are populated with XML with drag and drop activated. Thanks for bearing with a newbie. The innerHTML script: function showText(){ var myTemplateholder = document.getElementById('myTemplateholder').value; document.getElementById('showMe').innerHTML = myTemplateholder; } The build your template container Div: <div id="myTemplateholder"> <div id="treeboxbox_tree" style="width:auto; height:218px;background-color:#DEF1F8;overflow:hidden"> </div> </div> <input name="Preview" type="button" class="submit" value="Preview Template" onclick="showText()" /> And the WYSIWYG holding area: <div id="showMe"><p> </p></div> Answer posted by Alex (support) on Oct 30, 2009 03:41 div doesn't have value property. Try to use innerHTML instead: var myTemplateholder = document.getElementById('myTemplateholder').innerHTML; Answer posted by Letitia Stellern on Oct 30, 2009 09:03 Once again, thanks for your help Alex! |