JavaScript UI Libraries & Blazor Components Suite – Smart UI › Forums › Menu & Tree › Menu itemClick / itemCheckedChange On
Tagged: angular menu, close, close menu, menu, Menu Event, preventCloseOnCheck, smart menu
- This topic has 3 replies, 2 voices, and was last updated 4 years ago by admin.
-
AuthorPosts
-
November 16, 2020 at 12:51 pm #101149adminKeymaster
Hello,
I have used the menu Container like that:<smart-menu checkboxes check-mode="checkbox" checkable id="menu" mode="dropDown"> <smart-menu-item id="employeeItem">Mitarbeiter</smart-menu-item> <smart-menu-item id="vehicleItem">Fahrzeuge</smart-menu-item> <smart-menu-item id="scaleItem">Waage</smart-menu-item> <smart-menu-item id="workshopItem">Werkstätte</smart-menu-item> <smart-menu-item id="presenceItem">Anwesenheit</smart-menu-item> </smart-menu>
Sadly the Menu still closes automatically and the items get checked.
const menu = document.getElementById('menu'); menu.addEventListener('itemClick', function(event){ event.preventDefault(); }); menu.addEventListener('itemCheckChange', function(event){ event.preventDefault(); });
Is there any other way to prevent the standard event?
Best Regards
DennisNovember 16, 2020 at 1:40 pm #101150adminKeymasterHi Dennis,
Thank you for the feedback. Unfortunately, there is currently no way to achieve what you require. However, in the next release, we will introduce a new Smart.Menu Boolean property – preventCloseOnCheck (prevent-close-on-check), that will prevent the closing of Menu items if enabled.
Best regards,
Dimitar
Smart HTML Elements Team
https://www.htmlelements.comNovember 16, 2020 at 1:48 pm #101151adminKeymasterHi Dimitar,
Thank you for the quick response.
Is it possible to prevent it from getting checked though? I want to make a maximum of 4 checkable.
Best regards,
DennisNovember 16, 2020 at 2:03 pm #101152adminKeymasterHi Dennis,
Unfortunately, such a feature is not supported. If you wish, you can contact sales@jqwidgets.com and request it as a custom development service.
There is also another feature that may be useful to you – mixed check mode – this way you can make only particular items in a pop-up checkable and others – not – by separating them with a separator. Here is a demo on the matter: https://www.htmlelements.com/demos/menu/mixed-check-mode/.
Best regards,
Dimitar
Smart HTML Elements Team
https://www.htmlelements.com -
AuthorPosts
- You must be logged in to reply to this topic.