1

I've developed Menu for my dashboard where I use metisMenu for my elements. The menu is getting displayed, but when i click button of menu for diplay submenu, the SubMenu is not displayed !

How to fix this problem and thank's. file .html:

 <ul class="side-menu metismenu" *ngFor="let application of applications">
    <li routerlinkactive="active">
      <a href="javascript:;">
        <i class="sidebar-item-icon fa fa-bookmark"></i>
        <span class="nav-label">{{application.Menu}}</span><i class="fa fa-angle-left arrow"></i>
      </a>
      <ul class="nav-2-level collapse" routerlinkactive="in" *ngFor="let accessrole of accessroles">
        <li *ngIf="accessrole.ApplicationId == application.ApplicationId">
          <a routerlink="/ui/icons" routerlinkactive="active">
            <span class="nav-label" style="padding-left: 23px; margin-top: -19px;">{{accessrole.SubMenu}}</span>
          </a>
        </li>
      </ul>
    </li>
  </ul>
adam
  • 11
  • 5

1 Answers1

0
import React from 'react';
import ReactDOM from 'react-dom';
import MetisMenu from 'react-metismenu';
 
const content=[
    {
        icon: 'icon-class-name',
        label: 'Label of Item',
        to: '#a-link',
    },
    {
        icon: 'icon-class-name',
        label: 'Second Item',
        content: [
            {
                icon: 'icon-class-name',
                label: 'Sub Menu of Second Item',
                to: '#another-link',
            },
        ],
    },
];
 
ReactDOM.render(
  <MetisMenu content={content} activeLinkFromLocation />,
  document.getElementById('root')
);

If you are using react can you try the above?. Also please refer to more clarification on metis menu from https://www.npmjs.com/package/react-metismenu

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Nov 13 '22 at 20:40