Menu is not redrawn/replaced when webix_ui is used

edited July 2014 in Technical questions


I tried to replace a menu based on
look for replace any existing object.
however menu does not change, see snippet:
click "update menu" button.

Thank you


  • edited July 2014


    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]);

    Btw, if you don't define an ID manually, a view gets an auto-generated one. It can be accessed via the view object:
  • just for pasterity here is the snippet showing update of the menu without replacing the view but redefining data property of config:

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!