In the beforeRender event handler you are allowed to mark an item as a leaf or a branch. For this purpose, you should use the set_kids() method. As the input parameter true or false must be specified. true marks an item as a branch, false - as a leaf.
Back to top