Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by abhishek on Aug 31, 2009 06:22
open dhtmlx forum
TREE: Is ite possible to insert a node b/w two nodes

TREE: Is it possible to insert a node b/w two nodes?
Answer posted by Alex (support) on Aug 31, 2009 09:40
You can use insertNewNext method
Answer posted by abhishek on Sep 01, 2009 02:23
how to insert node in the first position i.e. before all the childs of a parent node?

for example: I have 3 child nodes occupying index positions 0,1,2 .I want to insert a new child at index position 0
Answer posted by Alex (support) on Sep 01, 2009 02:51

You can use moveItem method to move item to the first position:

tree.insertNewNext(top_item_id,new_item_id,text);

tree.moveItem(new_item_id,"up_strict");

Answer posted by abhishek on Sep 01, 2009 03:12
thanks for the reply....

i have used

tree.insertNewChild(parent_item_id,new_item_id,text);

tree.moveItem(new_item_id,"up_strict");

it didnot worked

Answer posted by Alex (support) on Sep 01, 2009 03:16
Try to use tree.insertNewNext(top_item_id,new_item_id,text); instead of tree.insertNewChild(parent_item_id,new_item_id,text);
Answer posted on Sep 01, 2009 03:17
its working with insertNewNext(...)
thanks