This example shows how to add tools (actions) in tree nodes. The tools added here allow moving the layers up and down and deleting them.
The js is not minified so it is readable. See tree-actions.js.