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.