clearMenuState

Forum rules
Please note that response time for technical support is within 3-5 business days.
spadovan
Posts: 178
Joined: 05 Jun 2013, 12:04

22 Feb 2017, 16:55

Hi Aragorn...it's still me.

I've putted this code in the page wjere i like to clear menu:

Code: Select all

		<script>
			$( document ).ready(function() {
				PF('sidebar-menu').clearMenuState();
				PF('sidebar-menu').clearActiveItems();
			});
		</script>
When i enter in this page the menu is cleared but the cookie is valorized whith the current menu item selected, so if then i click on another menu item, it will highlight both of them...

Thanks
Primefaces 12.0.2, Wildfly 24.0.1, JDK 11

spadovan
Posts: 178
Joined: 05 Jun 2013, 12:04

22 Feb 2017, 16:57

BTW i'm currently using ultima layout....not omega
Primefaces 12.0.2, Wildfly 24.0.1, JDK 11

spadovan
Posts: 178
Joined: 05 Jun 2013, 12:04

02 Mar 2017, 10:46

I resolved modifying the code of the clearActiveItems function, adding

this.expandedMenuitems = [];

Code: Select all

	clearActiveItems: function () {
		var activeItems = this.jq.find('li.active-menuitem');
		subContainers = activeItems.children('ul');

		activeItems.removeClass('active-menuitem');
		if (subContainers && subContainers.length) {
			subContainers.hide();
		}
[b]		this.expandedMenuitems = [];[/b]
	},
Primefaces 12.0.2, Wildfly 24.0.1, JDK 11

mert.sincan
Posts: 5281
Joined: 29 Jun 2013, 12:38

07 Mar 2017, 15:43

Good solution, thanks alot for the update!

Post Reply

Return to “Omega - PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 12 guests