Skip to content Skip to sidebar Skip to footer

Jquery (metis-menu) Not Working With Iron:router In Meteor

I'm trying to implement a sidebar (leveraging the sidebar from sb-admin-2When I use the side bar as part of main.html, the toggles work perfectly fine. However, when I implement th

Solution 1:

This is how I resolved it.

AppLayout:

<templatename="Index"><divid="wrapper"><!-- Navigation -->
        {{> navigationBar}}
        {{> Sidebar}}
        <divid="page-wrapper"><divclass="row breadcrumbPosition">
                {{> breadcrumb}}
            </div><!-- /.row --><divclass="row"><divclass="col-xs-9 blockablelockable">
                    {{> yield}}
                </div></div></div><!-- /#page-wrapper --></div><!-- /#wrapper --></template>

Sidbar.html is a template with the original sidebar implementation.

SidebarHelper.js contains an functino in onRendered which initializes the metis menu like so:

Template.Sidebar.onRendered( function(){

    $('.metisMenu').metisMenu({
      toggle: true// disable the auto collapse. Default: true.
    });
});

Post a Comment for "Jquery (metis-menu) Not Working With Iron:router In Meteor"