Page 1 of 1

how to highlight <p:menuitem>

Posted: 03 Jun 2018, 20:27
by afro22
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.

Re: how to highlight <p:menuitem>

Posted: 11 Jun 2018, 08:13
by aragorn
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();