Showing tree as menu item

In this sinppet http://webix.com/snippet/0a333066 i attempt and fail to show tree as menu item.
Menu building part of the code is from sample http://docs.webix.com/samples/03_menu/02_menubar_template.html

Tree building is from http://docs.webix.com/samples/17_datatree/01_loading/03_big_data.html

I wonder whether i failed because it’s impossible to have dynamic stuff in menu items or because i am doing something wrong.

You are overcompicating code a bit.

Instead of creating tree in the separate html container, why do not create it directly as part of the submenu.

http://webix.com/snippet/01a7a986

Brilliant! Thank you