tree.lockItem

is it possible to lock an item with dhtmlxTree.

i tryed the following code from the forum:



tree.lockItem(‘ID’,true);



but only get following failure:

“tree.lockItem is not a function”



i have tried this with the Sample from: /samples/drag_n_drop/tree_drag.html



tree=new dhtmlXTreeObject(“treeboxbox_tree”,“100%”,“100%”,0);

            tree.setImagePath(“…/…/codebase/imgs/csh_yellowbooks/”);

            tree.enableDragAndDrop(true);

            tree.loadXML(“tree.xml”);

            tree.lockItem(‘rc’,true);



            tree2=new dhtmlXTreeObject(“treeboxbox_tree2”,“100%”,“100%”,0);

            tree2.setImagePath(“…/…/codebase/imgs/csh_yellowbooks/”);

            tree2.enableDragAndDrop(true);

            

            tree2.loadXML(“tree.xml”);



greets michael

There are two issues
a) dhtmlxtree_li.js need to be included in HTML page
b) loading of data is async, so correct code will be
    tree.loadXML(“tree.xml”,function(){
          tree.lockItem(‘rc’,true);

    });
 


Thanks, this work! But i have the next question.

Is it possible to insert a item with drag and drop to a locked Item?

greets michael

The item in locked state can’t be draged, and can’t be used as drop target.