Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Letitia Stellern on Oct 29, 2009 06:40
open dhtmlx forum
Initilizing from HTML

Question - I have had to change my dhtmlxtree structure so that it initilizes from HTML instead of XML.

I have added dhtmlxtree_start.js & dhtmlxtree.js to the beginning of my code, id="templateTree" to my container DIV and tree = new dhtmlXTreeObject("templateTree", "100%", "100%", 0); to the end of my code in a <script> tag.

However, when I try to add any drag and drop functionality to the tree: tree.enableDragAndDrop or tree.setDragBehavior -- it errors. What am I doing wrong? (sorry for the newbie questions, but I am one)

Thanks!
Answer posted by Alex (support) on Oct 29, 2009 11:45

Hello,

dhtmlXTreeObject can not be used in case of html initialization. 

You can only use dhtmlXTreeFromHTML. But in this case class="dhtmlxTree" should be excluded from the <div> tag.

var tree = dhtmlXTreeFromHTML('templateTree');

To enable dra-n-drop enableDragAndDrop  and setDragBehavior can be set as the attributes of tree div:

<div id="templateTree" enableDragAndDrop="true" setDragBehavior="sibling" ...>...</div>

Answer posted by Letitia Stellern on Oct 29, 2009 11:51
Thanks Alex!