Server-side actions:
- Set the Enabled property of any nodes that should not be editable to false.
- Hook-up the server-side client-side AfterBeginNodeEdit event e.g. tree.ClientSideEvents.AfterBeginNodeEdit = "tree_afterBeginNodeEdit".
Client-side actions:
- Provide an event handler for afterBeginNodeEdit e.g.
function tree_afterBeginNodeEdit(treeId, nodeId)
{
var tree = igtree_getTreeById(treeId);
var node = igtree_getNodeById(nodeId);
if(tree != null && node !=null)
{
if(node.getEnabled() == false)
{
tree.endEdit(true);
}
}
}
The two key points here are:
- Hook up the AfterBeginNodEdit event. Looking at the documentation the BeforeBeginNodeEdit event would be the logically event to handle. However calling the endEdit method in this event does not work as the edit control does not yet exist (had to debug the Infragistics code to figure this one).
- Call endEdit which cancels the non-editable node from being edited.
Hope this helps!