hi all,
can anyone till me how theme determine which is the active p:menuitem in p:submenu ??
i try this
<po:menu widgetVar="PoseidonMenuWidget">
<p:submenu label="Requests">
<p:menuitem value="test" outcome="/welcome"/>
<p:menuitem value="test2" outcome="/welcome_1"/>
</p:submenu>
</po:menu>
i get this
thanks ...
active p:menuitem in p:submenu
Forum rules
Please note that response time for technical support is within 3-5 business days.
Please note that response time for technical support is within 3-5 business days.
-
- Posts: 5
- Joined: 06 May 2018, 08:54
Thank you for replying,
You mean searching the url and what in p:menuitem outcome ??
If yes , Can you please help me to find where i can modify that ?
I need to change it to p:menuitem id not outcome
Thanks
You mean searching the url and what in p:menuitem outcome ??
If yes , Can you please help me to find where i can modify that ?
I need to change it to p:menuitem id not outcome
Thanks
Hi,
Please take a look at old version of the poseidon templates' layout.js file. I will try to explain about your requested code. You should modify layout.js functions.
Best Regards,
Please take a look at old version of the poseidon templates' layout.js file. I will try to explain about your requested code. You should modify layout.js functions.
Code: Select all
init: function(cfg) {
.
.
.
this.expandedMenuitems = this.expandedMenuitems||[];
},
removeMenuitem: function (id) {
this.expandedMenuitems = $.grep(this.expandedMenuitems, function (value) {
return value !== id;
});
this.saveMenuState();
},
addMenuitem: function (id) {
if ($.inArray(id, this.expandedMenuitems) === -1) {
this.expandedMenuitems.push(id);
}
this.saveMenuState();
},
saveMenuState: function() {
if(this.isHorizontal()) {
return;
}
if(this.wrapper.hasClass('layout-wrapper-static'))
$.cookie('poseidon_menu_static', 'poseidon_menu_static', {path: '/'});
else
$.removeCookie('poseidon_menu_static', {path: '/'});
$.cookie('poseidon_expandeditems', this.expandedMenuitems.join(','), {path: '/'});
},
clearMenuState: function() {
this.expandedMenuitems = [];
$.removeCookie('poseidon_expandeditems', {path: '/'});
$.removeCookie('poseidon_menu_static', {path: '/'});
},
clearActiveItems: function() {
var activeItems = this.jq.find('li.active-menuitem'),
subContainers = activeItems.children('ul');
activeItems.removeClass('active-menuitem');
if(subContainers && subContainers.length) {
subContainers.hide();
}
},
clearLayoutState: function() {
this.clearMenuState();
this.clearActiveItems();
},
restoreMenuState: function() {
var menuCookie = $.cookie('poseidon_expandeditems');
if (menuCookie) {
this.expandedMenuitems = menuCookie.split(',');
for (var i = 0; i < this.expandedMenuitems.length; i++) {
var id = this.expandedMenuitems[i];
if (id) {
var menuitem = $("#" + this.expandedMenuitems[i].replace(/:/g, "\\:"));
menuitem.addClass('active-menuitem');
var submenu = menuitem.children('ul');
if(submenu.length) {
submenu.show();
}
}
}
}
.
.
.
},
-
- Posts: 5281
- Joined: 29 Jun 2013, 12:38
Hi,
Is your problem solved with the above code blocks?
Best Regards,
Is your problem solved with the above code blocks?
Best Regards,
Github Profile: https://github.com/mertsincan
Hi, I tell you that the problem persists, I did not understand the above, I copy the code in the layout.js?mert.sincan wrote: ↑21 Jan 2022, 09:31Hi,
Is your problem solved with the above code blocks?
Best Regards,
<po:menu widgetVar="PoseidonMenuWidget">
<p:submenu id="om_components" label="#{bundle.label_menu}" icon="pi pi-star-fill">
<p:menuitem id="om_dashboard" value="#{bundle.label_dashboard}" icon="pi pi-home" outcome="#{bundle.ruta_url_dashboard}"/>
<p:menuitem id="om_useradmin" value="#{bundle.label_gestion_usuario}" icon="pi pi-users" rendered="#{appMenu.menuBarAdministracion}" outcome="#{bundle.ruta_url_gestion_usuario}"/>
<p:submenu id="om_balances" label="#{bundle.label_balance}" rendered="#{appMenu.menuBarAdministracion}" icon="pi pi-chart-line">
<p:menuitem id="om_bl_libro_inventario" value="#{bundle.label_balance_libro_inventario}" rendered="#{appMenu.menuBarAdministracion}" icon="pi pi-cog" outcome="#{bundle.ruta_url_libro_inventario}" />
</p:submenu>
......
They appear active to me, because this happens if I have the pro and extended version.
-
- Information
-
Who is online
Users browsing this forum: No registered users and 18 guests