Set Menu Item Active

Forum rules
Please note that response time for technical support is within 3-5 business days.
Post Reply
contactvpatel
Posts: 1
Joined: 16 Sep 2021, 17:48

16 Sep 2021, 17:53

I have a CRUD operation Page as example Manage Products in which on Create, I am not showing Create Product in Popup but showing in full page. But when I do that, I loose active menu from navigation. How do I programmatically set active menu for any page?


Image

merve7
Posts: 861
Joined: 12 Sep 2017, 10:44

28 Sep 2021, 19:44

Hi,
Maybe you can use 'updateActiveStateFromRoute(app.menuitem.component.ts) function for setting active class programmatically. Like;

Code: Select all

        this.active = this.router.isActive(this.item.routerLink[0] || your_url(create page url), this.item.items ? false : true);
or you can change this class value

Code: Select all

        '[class.active-menuitem]': '(active && !root) || (active && appMain.isSlim())'
Best regards,
Merve Özçifçi

Post Reply

Return to “Ultima - PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 3 guests