To make tree (or its elements) unselectable use dojo.html.disableSelection in nodeCreate and treeCreate hooks. Apply disableSelection to every node you want to make unselectable.
There is an "objectId" property and "object" property ready to be filled in from markup or program-way.
You may use dojo.lang.forEach(nodeOrTree.getDescendants(),function(elem) { ... })
to process all descendants,
it will walk children
property recursively.
The safer way would be to call TreeCommon.prototype.processDescendants(nodeOrTree, filter, func)
, it will process all children
with func
, but will not descend into nodes if filter(node)
returns false. E.g see collapseAll
controller method uses it to collapse all widgets, but skip non-folders and data objects.
Make a single root node with actionsDisabled="DETACH;MOVE". User will be unable to remove it, so interface will stay sane.
There are 2 ways. The first one is to attach TreeSelector and hook on "select" event. So when a user clicks, event handler will change url to node.object.href. Of course, you should fill hrefs.
A probably more convinient path would be to employ TreeLinkExtension, which will turn your labelNodes into real links, and apply attrbutes from node object to them.
Dojo performs actions not only when a node is created, but also cleanup when a node is destroyed. Lazy features allow node creation be distributed in time, but when you navigate away from a large tree, cleanup need some time. I don't know a way to evade that.