Disable edit when using ItemEditor

I’m looking for a way to disable editing of child nodes. Parent nodes - ie: Folders - can be created and renamed,however the child nodes need to remain named as they were from the database.

Is there any way to disable editing upon creation of a child node?

You can use “onEdit” event to disable editing of necessary items. You should return false from “onEdit” event handler in stage 0. Please find more information here docs.dhtmlx.com/doku.php?id=dhtm … ent_onedit

Well that worked - sort of. When I set one item as non-editable, it sets the whole tree. I don’t fully understand the parameters of the onEdit function.

The parameters STATE, ID, TREE, and VALUE…are all of these required or can I leave out what is not needed? Is there an example I can see? When I try to change values of the parameters, I get errors.

Thanks for your help.

Try to use following code:

tree.attachEvent("onEdit", function(state,id,tree,value){ if (state==0&&tree.getLevel(id)>1){ return false } return true });