HTML Elements Forums Navigation Menu & Tree Menu itemClick / itemCheckedChange On

This topic contains 3 replies, has 2 voices, and was last updated by Avatar Dimitar 1 week ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #101149
    Avatar
    Dennis
    Participant

    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

    #101150
    Avatar
    Dimitar
    Participant

    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

    #101151
    Avatar
    Dennis
    Participant

    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

    #101152
    Avatar
    Dimitar
    Participant

    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

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.