You may also want to read the documentation on open_branch, close_branch, open_all and close_all. To initially open some nodes when the tree loads - take a look at the opened config option. When opening/closing the beforeopen, beforeclose, onopen, onclose, onopen_all and onclose_all callbacks are triggered.