Adding Tree nodes via context menus


Hello,<?xml:namespace prefix = o ns = “urn:schemas-microsoft-com:office:office” /><o:p></o:p>



I am working on editable tree and trying to  add/delete nodes via context menus. <o:p></o:p>



Used code  for adding nodes: <o:p></o:p>



tree.insertNewItem(tree.getSelectedItemId(),d.valueOf(),’’,0,0,0,0,‘SELECT’); <o:p></o:p>



and <o:p></o:p>



tree.insertNewNext(tree.getSelectedItemId(),d.valueOf(),’’,0,0,0,0,‘SELECT’); <o:p></o:p>



With above code, I can able to add a node where ever I want but that node is NOT in edit mode and not in focus. I am looking for node should be in editable mode immediate after creation.





Please let me know your thoughts.


Thanks,


RamaRao R.


Hello,


tree.enableItemEditor(true); /requires dhtmlxtree_ed.js/


var id = d.valueOf();


tree.insertNewNext(tree.getSelectedItemId(),id,’’,0,0,0,0,‘SELECT’);


tree.selectItem(id);


tree.editItem(id);