Hello,
Firstly, you should have defined an ID for a toolbar. Unless, there isn’t such view as $$(“toolbar”) in the app.
Secondly, when you replace one view with another one featuring the same ID - an error occurs and view looses this ID. It concerns replacing “navMenu” with “navMenu”. It could be solved by accessing the menu via the toolbar’s children array.
All in all, the replacement function looks like:
function updateMenuItems(menuItems) {
var menuConfig = createMenuConfig(menuItems,true);
webix.ui(menuConfig, $$('toolbar'), $$('toolbar').getChildViews()[2]);
}
http://webix.com/snippet/b6cc22a2
Btw, if you don’t define an ID manually, a view gets an auto-generated one. It can be accessed via the view object:
view.config.id