Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Michael on May 29, 2008 04:04
open dhtmlx forum
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
Answer posted by Support on May 30, 2008 03:40
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);
    });
 

Answer posted by Michael on Jun 02, 2008 02:48
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
Answer posted by Support on Jun 02, 2008 08:25
The item in locked state can't be draged, and can't be used as drop target.