在多个地方显示dhtmlxtree

时间:2015-07-07 09:39:46

标签: dhtml dhtmlx

我创建了hhtmlxtree,使用以下代码显示正确:

<script>
  var myTree;
  myTree = new dhtmlXTreeObject("treeboxbox_tree","100%","100%",0);
  myTree.setImagePath("/library/dhtmlxTree/codebase/imgs/dhxtree_skyblue/");
  myTree.setImagePath("/library/dhtmlxTree/skins/terrace/imgs/dhxtree_terrace/");
  myTree.setXMLAutoLoading('customer/tree');
  myTree.setDataMode("json");
</script>
<div id="treeboxbox_tree"></div>

我想在'#treeboxbox_tree'这样的多个地方展示同一棵树。如何在没有每次为树初始化对象的情况下执行此操作。

1 个答案:

答案 0 :(得分:0)

对于DHTMLX组件,您需要为需要树的每个位置运行init代码。您无法克隆已创建的组件。