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 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!
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
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” …>…
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” …>…
Thanks Alex!