jQWidgets Forums

jQuery UI Widgets Forums Navigation Menu, Context Menu Disabled menu item still triggers click event

This topic contains 2 replies, has 2 voices, and was last updated by  jcwren 9 years, 11 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author

  • jcwren
    Participant

    User Nguyen Huu Hanh Lam reported here that the ‘click’ event was still triggered when a menu item is disabled, and Peter Stoev replied that the events should be bound to the ‘itemclick’ event, not ‘click’. That’s all good until href’s are used in the menu, such as the jqWidgets example here. Because of this, menu items that use links will still go to wherever the href points to, which effectively makes the menu item not disabled.

    This jsFiddle demonstrates the issue. It’s basically a clone of the example, but with an href on the ‘Events’ menu entry.


    Peter Stoev
    Keymaster

    Hi jcwren,

    As pointed out on many places in this Forum, you should use “itemclick” to trigger Menu clicks. We don’t support other events. We support only the API Documented events which is what you are supposed to use if you want to work with jQWidgets.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com


    jcwren
    Participant

    So you’re saying that your examples are flawed, and should not be using href tags for the menu actions? Because, if you’ll notice, neither your example or mine directly binds anything to either the ‘click’ or ‘itemclick’ event. The default functionality example doesn’t show binding anything to ‘itemclick’, and implies that for a menu bar, the correct pattern for linking to another page is href tags.

    Are you instead implying that an ‘itemclick’ handler should be installed, and that should check if an href tag is present, and redirect if necessary? Or is there just no example showing how a real-world application might actually use jqxMenu?

    It seems that based on your reply that you must have stopped reading after the first sentence.

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

You must be logged in to reply to this topic.