how to highlight <p:menuitem>

Post Reply
afro22
Posts: 2
Joined: 11 Oct 2015, 17:48

03 Jun 2018, 20:27

i create menu

Code: Select all

<pc:menu widgetVar="me" >
    <p:menuitem id="om_users" value="Users" icon="fa fa-users" outcome="/app/users"/>
    <p:menuitem id="om_files" value="Videos" icon="fa fa-copy" outcome="/app/videos"/>
</pc:menu>
but after start i have active item Videos (last item), i want to active first item.

User avatar
aragorn
Posts: 2985
Joined: 29 Jun 2013, 12:38

11 Jun 2018, 08:13

You can add 'active-menuitem' class to a menuitem. OR we use cookie to highlight a menuitem after refreshing page, logout/login etc. Maybe, you can use it. Exp;

Code: Select all

var menuWidget = PF('me');
menuWidget.clearMenuState();
menuWidget.addMenuitem('MENUITEM_CLINTID');
menuWidget.restoreMenuState();

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest