Side Menu Navigation

Forum to discuss the new web client version of Servoy.

Side Menu Navigation

Postby dev-ws-011 » Mon May 24, 2021 2:42 pm

Hi All,

We have been using svyNavigation module with some minor modifications. We have added submenus to side navigation and it contains list of forms user has accessed.

We are able to navigate to these last accessed forms successfully by clicking but side menu does not highlight main menu instead only highlights submenu while same id is bound to these.

We need to highlight main menu as well of that form.

We have used following code to set selected menu but it doest not highlight main menu:
Code: Select all
elements.sidenav.setSelectedMenuItem(menuItemId);


Any help will be highly appreciated.

Regards
Servoy Developer
dev-ws-011
 
Posts: 73
Joined: Fri Oct 21, 2016 8:23 am

Re: Side Menu Navigation

Postby pitc » Mon May 24, 2021 9:01 pm

In my solution the main menu item is highlighted all the time when user selecta any sub menu item.
The form extends the svyNavigationUX and I override the onOpen method:
Code: Select all
   
  //  update the selected menu item for the main menu
   var menuId = getMenuItemID(item.getFormName());
   if (menuId) {
      elements.sidenav.setSelectedMenuItemAsync(menuId);
   } else {
      elements.sidenav.setSelectedMenuItemAsync(null);
   }


So not sure if the async part helps, but it is working for me.
Does this help?
Tom
prospect-saas.com
pitc
 
Posts: 115
Joined: Thu Nov 14, 2019 2:22 pm
Location: Ottawa, Ontario, Canada

Re: Side Menu Navigation

Postby pitc » Mon May 24, 2021 10:58 pm

What version of Servoy and Navigation are you using?
Tom
prospect-saas.com
pitc
 
Posts: 115
Joined: Thu Nov 14, 2019 2:22 pm
Location: Ottawa, Ontario, Canada

Re: Side Menu Navigation

Postby dev-ws-011 » Tue May 25, 2021 8:47 am

I am using Servoy ver 2020.12 and svyNavigation v 1.0.3.

Yes, menu is highlighted always for menu clicked. I need to use a submenu which list last accessed forms and when user clicks on any last accessed form(in submenu) then I need to highlight related menu item in main menu not submenu item.

Regards
Servoy Developer
dev-ws-011
 
Posts: 73
Joined: Fri Oct 21, 2016 8:23 am

Re: Side Menu Navigation

Postby paronne » Tue May 25, 2021 9:32 am

Hi,

by default the side navigation highlights both the selected menu item and it's submenu item. The highlight behavior can be customized with the Theme + solution's styleSheet.
In your message you mention:

We are able to navigate to these last accessed forms successfully by clicking but side menu does not highlight main menu instead only highlights submenu while same id is bound to these.


Please note that each menu/submenu must have an unique id. If same id is used for multiple menu items/submenu items it may not behave as expected.

Regards,
Paolo
paronne
 
Posts: 202
Joined: Fri Nov 02, 2012 3:21 pm

Re: Side Menu Navigation

Postby dev-ws-011 » Tue Jun 08, 2021 3:31 pm

Thanks for all responses.

We have updated menu selection using svyNavigation api.

Thanks & Regards
Servoy Developer
dev-ws-011
 
Posts: 73
Joined: Fri Oct 21, 2016 8:23 am


Return to Servoy NGClient

Who is online

Users browsing this forum: No registered users and 10 guests