Servoy / bootstrapextracomponents

MIT License
1 stars 1 forks source link

navbar: setSubMenuItemEnabled does not work #17

Closed tgs-1 closed 5 years ago

tgs-1 commented 6 years ago

My default navbar setting is e.g.: ... { // taskmenu itemId: "4", displayType: "MENU_ITEM", iconName: "fa fa-th-large", position: "RIGHT", text: "i18n:cuvis.label.lc.menu", tooltip: "i18n:core.tooltip.lc.taskmenu", subMenuItems: [{ itemId: "4.1", iconName: "fa fa-plus", onAction: new_rec, text: "i18n:core.menuitem.text.lc.newrec" }, { itemId: "4.2", iconName: "fa fa-minus", onAction: delete_rec, text: "i18n:core.menuitem.text.lc.deleterec" }, { isDivider: true }, { itemId: "4.3", iconName: "fa fa-external-link", onAction: send, text: "i18n:core.menuitem.text.lc.send" }, { isDivider: true }, { itemId: "4.4", iconName: "fa fa-search", onAction: search, text: "i18n:core.menuitem.text.lc.search" }, { itemId: "4.5", iconName: "fa fa-database", onAction: all_rec, text: "i18n:core.menuitem.text.lc.allrec" }] }, ...

In some situations I would like to set subMenuItems enabled/disabled by function like this:

elements.navbar_1.setSubMenuItemEnabled("4","4.1",false); elements.navbar_1.setSubMenuItemEnabled("4","4.2",false); elements.navbar_1.setSubMenuItemEnabled("4","4.3",true); elements.navbar_1.setSubMenuItemEnabled("4","4.4",false); elements.navbar_1.setSubMenuItemEnabled("4","4.5",true);

But it doesn't work! Only setMenuItemEnabled works as expected

pruhsert commented 5 years ago

It works for me in the demo solution. When I click the "Create menu" button and then call

forms.demoNavBar.elements.navbar.setSubMenuItemEnabled('6', '6.2', false)

Then the "More action" submenu is disabled.