NavBar divider

Using Servoy to administrate the content of your website? Discuss all webrelated Servoy topics on this forum!

NavBar divider

Postby pitc » Wed Nov 11, 2020 2:34 am

I want to create a navbar menu and a submenu for one of the items.
In the submenu I want to programmatically add a divider instead of a MENU ITEM.
On the ide I can create the menu item and then the sub menu item and can set the isDivider to true.
How to do that for programming?
currently I use
Code: Select all
   //admin
   menuItem = elements.navbar_zff_manager.createMenuItem('Admin', DEFAULT_NAVBAR_ACTIONS.ADMIN, 'LEFT');
   menuItem.displayType = 'MENU_ITEM';
   menuItem.iconName = 'fas fa-user-secret';
   menuItem.styleClass = 'no-border';

   var admin_submenuItems = [];
   //sub menu items for admin
   var subMenuItem = elements.navbar_zff_manager.createMenuItem('Admin-Tally-Viewer', DEFAULT_ADMIN_NAVBAR_ACTIONS.TALLY_VIEWER);
   subMenuItem.iconName = 'fas fa-adjust';
   admin_submenuItems.push(subMenuItem);

   //divider
   /** @type {CustomType <bootstrapextracomponents-navbar.menuItem.subMenuItem>} */
   subMenuItem = elements.navbar_zff_manager.createMenuItem('divider');
   subMenuItem.displayType = 'MENU_ITEM';
...tbd...
..
   admin_submenuItems.push(subMenuItem);
   //at the end of the admin sub menu items
   menuItem.subMenuItems = admin_submenuItems;

   menuItems.push(menuItem);


I am not sure the Custom Type is correct (I could not find a reference for it in wiki or other places).
I am not sure this is possible at all.
Tom
prospect-saas.com
pitc
 
Posts: 115
Joined: Thu Nov 14, 2019 2:22 pm
Location: Ottawa, Ontario, Canada

Return to Web Development

Who is online

Users browsing this forum: No registered users and 7 guests