- This topic has 3 replies, 2 voices, and was last updated 3 years, 9 months ago by .
Viewing 4 posts - 1 through 4 (of 4 total)
Viewing 4 posts - 1 through 4 (of 4 total)
- You must be logged in to reply to this topic.
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
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
Dennis
Hi 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.com
Hi 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,
Dennis
Hi 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