question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Adding items to menu

See original GitHub issue

I am building a backbone client app that adds one or more

  • items after fetching data from an API asynchronously. It does not seem to be possible to make metis menu work for
  • items that are added at a later stage. I can call $('#side-menu').metisMenu() a second time but it won’t pick up the new items.

  • Issue Analytics

    • State:open
    • Created 9 years ago
    • Comments:15 (1 by maintainers)

    github_iconTop GitHub Comments

    1reaction
    garhbodcommented, Mar 21, 2018

    For angularJs I had to add a timeout to wait for the dom change before running metisMenu again

                // After changes to dom
                $timeout(function() {
                    var sideMenu = angular.element('[side-navigation]');
                    sideMenu.removeData("mm");
                    sideMenu.metisMenu();
                });
    
    1reaction
    sferozecommented, Aug 13, 2015

    I got it I had to change the code to:

    var sideMenu = $(this.sideMenuContainer);
    sideMenu.removeData("mm");
    sideMenu.metisMenu();
    
    Read more comments on GitHub >

    github_iconTop Results From Across the Web

    Add, remove, or edit menu items in your online store
    On the Navigation page, click the title of the menu that you want to edit. · Click Add menu item. · Enter a...
    Read more >
    Add and Edit Menus in WordPress | WordPress.com Support
    Reorder Menu Items. This guide will show you how to rearrange your menu items to be listed in the exact order that you...
    Read more >
    How to Add a Navigation Menu in WordPress (Beginner's Guide)
    Simply select the categories you want to add to the menu, and then click the 'Add to Menu' button. The categories will appear...
    Read more >
    Adding a New Menu Item - Easy WP Guide
    To add a new Page as a menu item, tick the checkboxes in the Pages panel, next to each of the Pages that...
    Read more >
    Add items with the @ menu - Google Docs Editors Help
    You can use the @ menu to link to people, files, and events, and add items to a Google Doc. With the @...
    Read more >

    github_iconTop Related Medium Post

    No results found

    github_iconTop Related StackOverflow Question

    No results found

    github_iconTroubleshoot Live Code

    Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
    Start Free

    github_iconTop Related Reddit Thread

    No results found

    github_iconTop Related Hackernoon Post

    No results found

    github_iconTop Related Tweet

    No results found

    github_iconTop Related Dev.to Post

    No results found

    github_iconTop Related Hashnode Post

    No results found